mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nam Cao <namcao@linutronix.de>
To: Gabriele Monaco <gmonaco@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	john.ogness@linutronix.de, linux-trace-kernel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 03/10] rv: Add infrastructure for linear temporal logic monitor
Date: Wed, 12 Mar 2025 15:29:53 +0100	[thread overview]
Message-ID: <20250312142953.HsobQDBG@linutronix.de> (raw)
In-Reply-To: <035d1f1a92f15bfa60d2d133131dd8a25b3c78e4.camel@redhat.com>

On Wed, Mar 12, 2025 at 07:47:50AM +0100, Gabriele Monaco wrote:
> On Tue, 2025-03-11 at 18:05 +0100, Nam Cao wrote:
> > -/*
> > - * Futher monitor types are expected, so make this a union.
> > - */
> >  union rv_task_monitor {
> > -	struct da_monitor da_mon;
> > +	struct da_monitor	da_mon;
> > +	struct ltl_monitor	ltl_mon;
> >  };
> 
> This adds quite some memory overhead if we have multiple per-task
> monitors (we might in the future) and we don't use this ltl monitors.
> What about keeping it conditionally compiled out?
> You could define the struct only if e.g. CONFIG_RV_LTL_MONITORS is set,
> select it with any LTL monitor via Kconfig, then glue it somehow to
> have it readable.

Good point.

> > diff --git a/tools/verification/ltl2ba/generate.py
> > b/tools/verification/ltl2ba/generate.py
> > new file mode 100755
> > index 000000000000..52d5b3618e64
> > --- /dev/null
> > +++ b/tools/verification/ltl2ba/generate.py
> 
> You may want to rename this script to something more unique, just in
> case one day we decide to make it possible to install this generator on
> the system (like dot2k/dot2c).

Acked. Inspired by the dot2k name, maybe something like ltl2k.

> > + * rv_%%MODEL_NAME%%_get_data - get the custom data of this monitor.
> > + * @mon: the monitor
> > + *
> > + * If this function is used, rv_%%MODEL_NAME%%_init() must have been
> > called with a positive
> > + * data_size.
> > + */
> > +static inline void *rv_%%MODEL_NAME%%_get_data(struct ltl_monitor
> > *mon)
> > +{
> > +	return &mon->data;
> > +}
> 
> Do we need all those functions defined here? We could have them
> generated by the pre-processor just like with DA monitors.
> 
> Having a ltl_monitor.h defining all common utility functions and
> variables (here I'm assuming most are, indeed, common) may save a lot
> of maintenance.

I avoided macros like with DA monitors, they are hard to grep. But your
point on maintenance is true from my experience working on this series..

Pre-processor it is then.

> Also I would rearrange monitors sources a bit differently, like putting
> everything that doesn't need manual intervention (states and atoms
> lists) in the header, remaining functions that may need tracepoint
> wiring or more complex stuff can stay in a single c file, a bit like
> current da monitors.
> 
> I see there seems to be more manual work in the main C file (e.g.
> rtapp_block.c), but I think it would look cleaner if all other code was
> generated by the preprocessor in a common header and all lists/inlined
> functions created by the script stay in a separate header (why not call
> it rtapp_block.h?).
> 
> What do you think?

Sounds better, let me give me a try.

Thanks so much for the suggestions,
Nam

  parent reply	other threads:[~2025-03-12 14:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 17:05 [PATCH 00/10] RV: Linear temporal logic monitors for RT application Nam Cao
2025-03-11 17:05 ` [PATCH 01/10] rv: Add #undef TRACE_INCLUDE_FILE Nam Cao
2025-03-11 17:05 ` [PATCH 02/10] rv: Let the reactors take care of buffers Nam Cao
2025-03-12  7:58   ` Gabriele Monaco
2025-03-13  8:16     ` Nam Cao
2025-03-13 11:39       ` Gabriele Monaco
2025-03-13 16:07   ` kernel test robot
2025-03-13 16:07   ` kernel test robot
2025-03-11 17:05 ` [PATCH 03/10] rv: Add infrastructure for linear temporal logic monitor Nam Cao
2025-03-12  6:47   ` Gabriele Monaco
2025-03-12  9:56     ` Steven Rostedt
2025-03-12 14:29     ` Nam Cao [this message]
2025-03-11 17:05 ` [PATCH 04/10] rv: Add rtapp_block monitor Nam Cao
2025-03-12  7:34   ` Gabriele Monaco
2025-03-13 15:15   ` kernel test robot
2025-03-11 17:05 ` [PATCH 05/10] x86/tracing: Remove redundant trace_pagefault_key Nam Cao
2025-03-11 17:05 ` [PATCH 06/10] x86/tracing: Move page fault trace points to generic Nam Cao
2025-03-11 17:05 ` [PATCH 07/10] arm64: mm: Add page fault trace points Nam Cao
2025-03-11 17:05 ` [PATCH 08/10] riscv: " Nam Cao
2025-04-02  7:35   ` Alexandre Ghiti
2025-03-11 17:05 ` [PATCH 09/10] rv: Add rtapp_pagefault monitor Nam Cao
2025-03-11 17:05 ` [PATCH 10/10] rv: raise the number of per-task monitor to 2 Nam Cao
2025-03-12  6:57   ` Gabriele Monaco

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=20250312142953.HsobQDBG@linutronix.de \
    --to=namcao@linutronix.de \
    --cc=gmonaco@redhat.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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

all inboxes | Powered by JetHome®