Thank you Lwazi,
I'll take a look after the Workshop.

BR,

Alan

On Wed, Oct 15, 2025 at 12:18 AM Lwazi Dube <[email protected]> wrote:

> Alan,
> I have fixed the performance issue. It is fast now. I had to make 3
> changes.
>
> 1)
> CONFIG_SYSLOG_BUFFER=y
>
> 2)
> diff --git a/drivers/syslog/syslog_channel.c
> b/drivers/syslog/syslog_channel.c
> index 6bd80e6f5a..d1e47b54cf 100644
> --- a/drivers/syslog/syslog_channel.c
> +++ b/drivers/syslog/syslog_channel.c
> @@ -170,6 +170,7 @@ static const struct syslog_channel_ops_s
> g_default_channel_ops =
>    syslog_default_putc,
>    syslog_default_putc,
>    NULL,
> +  syslog_default_write,
>    syslog_default_write
>  };
>
> 3)
> diff --git a/arch/arm/src/common/arm_semi_syslog.c
> b/arch/arm/src/common/arm_semi_syslog.c
> index 702dbe35da..9fecac295d 100644
> --- a/arch/arm/src/common/arm_semi_syslog.c
> +++ b/arch/arm/src/common/arm_semi_syslog.c
> @@ -62,16 +62,14 @@ void up_putc(int ch)
>
>  void up_nputs(const char *str, size_t len)
>  {
> -  if (len == ~((size_t)0))
> -    {
> +#ifdef CONFIG_SYSLOG_BUFFER
> +      *(char *)(str + len) = 0;
>        smh_call(SEMI_SYSLOG_WRITE0, (char *)str);
> -    }
> -  else
> -    {
> +#else
>        while (len-- > 0)
>          {
>            up_putc(*str++);
>          }
> -    }
> +#endif
>  }
>  #endif
>

Reply via email to