EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Support for larger messages in IOC Error Logging facility
From: "J. Lewis Muir" <[email protected]>
To: Andrew Johnson <[email protected]>
Cc: [email protected]
Date: Wed, 08 Nov 2006 16:21:54 -0500
Andrew Johnson wrote:
J. Lewis Muir wrote:
I have a situation where I would like to log messages via the IOC Error Logging facility (e.g. errlogPrintf) that are longer than the current maximum message size of 256 characters (as of EPICS 3.14.8.2).

I see that I probably could change MAX_MESSAGE_SIZE in EPICS base at

src/libCom/error/errlog.c

but I'd rather not be running a modified EPICS base.

As a work around, I could break up the longer messages into smaller pieces, logging each piece individually, but I would rather not. Is there a better way to handle this?

I don't see any obvious reason why we can't make MAX_MESSAGE_SIZE an initialization parameter and add a 2-argument init routine to allow it to be set.


Or if I submitted a patch to allow a larger message size perhaps by changing the errlogInit function to allow a second argument of "int msgsize", would it likely be accepted or are there reasons against this?

If you would like to test out the attached (untested) patch and let me know if it solves the issue, I'll see that it gets into R3.14.9.


To increase the message size, call errlogInit2(0, maxMsgSize) before something else calls errlogInit(0).

- Andrew

Hi, Andrew.


Thanks for making this change!

I finally got a chance to test this.

To make it work from iocsh, I needed to make iocsh aware of this new errlogInit2 function so I modified

src/iocsh/iocCoreLimitsRegister.c

I've attached a patch for this against EPICS 3.14.8.2, but I know it's a trivial change for you to make against a newer version of this file if the patch does not apply cleanly.

Here are the results of my tests. When I refer to the number of characters, I am including the terminating null character in the count.

1. errlogInit2(1280, 1024)

   Tried writing 1024 characters via errlogPrintf:
   OK: Wrote full message on IOC console.
   OK: Wrote full message in iocLogServer output.

   Tried writing 1025 characters via errlogPrintf:
    ?: Wrote full message on IOC console. I was a little surprised by
       this, but maybe this is the expected behavior.
   OK: Wrote truncated message (i.e. most of the characters but with
       "<<TRUNCATED>>" at the end) in iocLogServer output.

   Tried writing 8192 characters via errlogPrintf:
    ?: Wrote full message on IOC console. Again, maybe this is the
       expected behavior.
   OK: Wrote truncated message in iocLogServer output.

2. errlogInit2(20000, 2050)

   Tried writing 1024 characters via errlogPrintf:
   OK: Wrote full message on IOC console.
   OK: Wrote full message in iocLogServer output.

   Tried writing 1025 characters via errlogPrintf:
   OK: Wrote full message on IOC console.
   OK: Wrote full message in iocLogServer output.

   Tried writing 1026 characters via errlogPrintf:
   OK: Wrote full message on IOC console.
    ?: Wrote full message in iocLogServer output, but as two entries
       (i.e. two timestamped entries with the first entry containing the
       first 1024 characters and the second entry containing the 1025th
       character). I think this might be because iocLogServer handles
       input 1024 characters at a time. This behavior is OK with me, but
       even nicer would be for it to handle messages longer than 1024
       characters by not splitting them into multiple entries.

   Tried writing 2050 characters via errlogPrintf:
   OK: Wrote full message on IOC console.
    ?: Wrote full message in iocLogServer output, but as three entries.
       Again, probably due to handling 1024 characters at a time.

Thanks again for making the change and being willing to get this into a future release!

-lewis
*** iocCoreLimitsRegister.c.orig	Thu Jul  8 12:15:01 2004
--- iocCoreLimitsRegister.c	Wed Nov  8 13:50:30 2006
***************
*** 69,78 ****
--- 69,91 ----
      errlogInit(args[0].ival);
  }
  
+ /* errlogInit2 */
+ static const iocshArg errlogInit2Arg0 = { "bufsize",iocshArgInt};
+ static const iocshArg errlogInit2Arg1 = { "maxMsgSize",iocshArgInt};
+ static const iocshArg * const errlogInit2Args[2] =
+     {&errlogInit2Arg0,&errlogInit2Arg1};
+ static const iocshFuncDef errlogInit2FuncDef =
+     {"errlogInit2",2,errlogInit2Args};
+ static void errlogInit2CallFunc(const iocshArgBuf *args)
+ {
+     errlogInit2(args[0].ival,args[1].ival);
+ }
+ 
  void epicsShareAPI iocCoreLimitsRegister(void)
  {
      iocshRegister(&callbackSetQueueSizeFuncDef,callbackSetQueueSizeCallFunc);
      iocshRegister(&dbPvdTableSizeFuncDef,dbPvdTableSizeCallFunc);
      iocshRegister(&scanOnceSetQueueSizeFuncDef,scanOnceSetQueueSizeCallFunc);
      iocshRegister(&errlogInitFuncDef,errlogInitCallFunc);
+     iocshRegister(&errlogInit2FuncDef,errlogInit2CallFunc);
  }

Replies:
Re: Support for larger messages in IOC Error Logging facility Andrew Johnson
References:
Support for larger messages in IOC Error Logging facility J. Lewis Muir
Re: Support for larger messages in IOC Error Logging facility Andrew Johnson

Navigate by Date:
Prev: channel access client performance and gateway Rowland, J (James)
Next: Re: Support for larger messages in IOC Error Logging facility Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Support for larger messages in IOC Error Logging facility Andrew Johnson
Next: Re: Support for larger messages in IOC Error Logging facility Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·