[PATCH 19/26] rv/rvgen: add abstract method stubs to Container class

Wander Lairson Costa posted 26 patches 2 weeks, 5 days ago
There is a newer version of this series
[PATCH 19/26] rv/rvgen: add abstract method stubs to Container class
Posted by Wander Lairson Costa 2 weeks, 5 days ago
The Container class extends RVGenerator but was missing implementations
for several abstract methods decorated with @not_implemented in the base
class. This could lead to NotImplementedError exceptions if code paths
attempt to call these methods on Container instances.

Add empty-string returning stub implementations for fill_tracepoint_handlers_skel,
fill_tracepoint_attach_probe, fill_tracepoint_detach_helper, and
fill_monitor_class_type. These empty returns are semantically correct
since Container is a grouping mechanism for organizing monitors, not an
actual monitor that generates tracepoint-specific C code.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
---
 tools/verification/rvgen/rvgen/container.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/verification/rvgen/rvgen/container.py b/tools/verification/rvgen/rvgen/container.py
index 51f188530b4dd..65df21dfd17b2 100644
--- a/tools/verification/rvgen/rvgen/container.py
+++ b/tools/verification/rvgen/rvgen/container.py
@@ -30,3 +30,15 @@ class Container(generator.RVGenerator):
                              self._kconfig_marker(), container_marker)
             return result
         return result + container_marker
+
+    def fill_tracepoint_handlers_skel(self) -> str:
+        return ""
+
+    def fill_tracepoint_attach_probe(self) -> str:
+        return ""
+
+    def fill_tracepoint_detach_helper(self) -> str:
+        return ""
+
+    def fill_monitor_class_type(self) -> str:
+        return ""
-- 
2.52.0
Re: [PATCH 19/26] rv/rvgen: add abstract method stubs to Container class
Posted by Gabriele Monaco 2 weeks, 3 days ago
On Mon, 2026-01-19 at 17:45 -0300, Wander Lairson Costa wrote:
> The Container class extends RVGenerator but was missing implementations
> for several abstract methods decorated with @not_implemented in the base
> class. This could lead to NotImplementedError exceptions if code paths
> attempt to call these methods on Container instances.
> 
> Add empty-string returning stub implementations for
> fill_tracepoint_handlers_skel,
> fill_tracepoint_attach_probe, fill_tracepoint_detach_helper, and
> fill_monitor_class_type. These empty returns are semantically correct
> since Container is a grouping mechanism for organizing monitors, not an
> actual monitor that generates tracepoint-specific C code.
> 
> Signed-off-by: Wander Lairson Costa <wander@redhat.com>
> ---

Just like the previous patch, the NotImplementedError here highlights a weakness
in the design we should improve instead of cover.
If all those fillers don't make sense for containers, we should instead move
them to Monitor and leave RVGenerator alone.

Thanks,
Gabriele

>  tools/verification/rvgen/rvgen/container.py | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/tools/verification/rvgen/rvgen/container.py
> b/tools/verification/rvgen/rvgen/container.py
> index 51f188530b4dd..65df21dfd17b2 100644
> --- a/tools/verification/rvgen/rvgen/container.py
> +++ b/tools/verification/rvgen/rvgen/container.py
> @@ -30,3 +30,15 @@ class Container(generator.RVGenerator):
>                               self._kconfig_marker(), container_marker)
>              return result
>          return result + container_marker
> +
> +    def fill_tracepoint_handlers_skel(self) -> str:
> +        return ""
> +
> +    def fill_tracepoint_attach_probe(self) -> str:
> +        return ""
> +
> +    def fill_tracepoint_detach_helper(self) -> str:
> +        return ""
> +
> +    def fill_monitor_class_type(self) -> str:
> +        return ""
Re: [PATCH 19/26] rv/rvgen: add abstract method stubs to Container class
Posted by Nam Cao 2 weeks, 2 days ago
Gabriele Monaco <gmonaco@redhat.com> writes:
> On Mon, 2026-01-19 at 17:45 -0300, Wander Lairson Costa wrote:
>> The Container class extends RVGenerator but was missing implementations
>> for several abstract methods decorated with @not_implemented in the base
>> class. This could lead to NotImplementedError exceptions if code paths
>> attempt to call these methods on Container instances.
>> 
>> Add empty-string returning stub implementations for
>> fill_tracepoint_handlers_skel,
>> fill_tracepoint_attach_probe, fill_tracepoint_detach_helper, and
>> fill_monitor_class_type. These empty returns are semantically correct
>> since Container is a grouping mechanism for organizing monitors, not an
>> actual monitor that generates tracepoint-specific C code.
>> 
>> Signed-off-by: Wander Lairson Costa <wander@redhat.com>
>> ---
>
> Just like the previous patch, the NotImplementedError here highlights a weakness
> in the design we should improve instead of cover.
> If all those fillers don't make sense for containers, we should instead move
> them to Monitor and leave RVGenerator alone.

Agree.

Nam
Re: [PATCH 19/26] rv/rvgen: add abstract method stubs to Container class
Posted by Wander Lairson Costa 2 weeks, 3 days ago
On Wed, Jan 21, 2026 at 02:59:09PM +0100, Gabriele Monaco wrote:
> On Mon, 2026-01-19 at 17:45 -0300, Wander Lairson Costa wrote:
> > The Container class extends RVGenerator but was missing implementations
> > for several abstract methods decorated with @not_implemented in the base
> > class. This could lead to NotImplementedError exceptions if code paths
> > attempt to call these methods on Container instances.
> > 
> > Add empty-string returning stub implementations for
> > fill_tracepoint_handlers_skel,
> > fill_tracepoint_attach_probe, fill_tracepoint_detach_helper, and
> > fill_monitor_class_type. These empty returns are semantically correct
> > since Container is a grouping mechanism for organizing monitors, not an
> > actual monitor that generates tracepoint-specific C code.
> > 
> > Signed-off-by: Wander Lairson Costa <wander@redhat.com>
> > ---
> 
> Just like the previous patch, the NotImplementedError here highlights a weakness
> in the design we should improve instead of cover.
> If all those fillers don't make sense for containers, we should instead move
> them to Monitor and leave RVGenerator alone.
> 

Yes, I agree. The design has a separate of concerns problem. The
previous comment apply here as well.

> Thanks,
> Gabriele
> 
> >  tools/verification/rvgen/rvgen/container.py | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/tools/verification/rvgen/rvgen/container.py
> > b/tools/verification/rvgen/rvgen/container.py
> > index 51f188530b4dd..65df21dfd17b2 100644
> > --- a/tools/verification/rvgen/rvgen/container.py
> > +++ b/tools/verification/rvgen/rvgen/container.py
> > @@ -30,3 +30,15 @@ class Container(generator.RVGenerator):
> >                               self._kconfig_marker(), container_marker)
> >              return result
> >          return result + container_marker
> > +
> > +    def fill_tracepoint_handlers_skel(self) -> str:
> > +        return ""
> > +
> > +    def fill_tracepoint_attach_probe(self) -> str:
> > +        return ""
> > +
> > +    def fill_tracepoint_detach_helper(self) -> str:
> > +        return ""
> > +
> > +    def fill_monitor_class_type(self) -> str:
> > +        return ""
>