[BusyBox] [PATCH] syslogd circular buffer size configuration

Stewart Brodie stewart.brodie at pace.co.uk
Mon Mar 3 04:48:03 UTC 2003


The circular buffer support in busybox's syslogd is just what we need for our
project, but we need a larger buffer.

Please find attached a small patch against the latest busybox (CVS unstable)
which adds:

  1) a new configuration option CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE which
     is the size of the circular buffer in kilobytes (sysklogd/Config.in)
     
  2) change to sysklogd/syslogd.c to validate & use the new option
  
  3) fix for scope and qualification of two variables (data_size/shm_size
     now static const int, not just int)


Other information:

The minimum value for this option is 4.  syslogd.c will #error if the value
is less than 4.  This value has been chosen arbitrarily.  I couldn't see a
way of enforcing this in Config.in - is it possible to insert range checks?

The original size of the shared memory block was around 16000 bytes plus the
header size.  The default value for the new option is 16 which results in a
shared memory block of 16384 bytes which *includes* the header size.  In real
terms, I believe it to be unlikely that this will have any effect on memory
usage since this will just end up rounding the total size up to the next
multiple of the memory page size (if the page size is >=512 bytes), thus
making available an extra 372 bytes which would have been wasted under the
initial implementation.

In addition to changing the default values assigned to the two variables
data_size and shm_size, the variables have been made static const int instead
of unqualified plain int.  There is no way provided to change the value, and
the variables are private to syslogd.c

-- 
Stewart Brodie, Senior Software Engineer
Pace Micro Technology PLC
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom         WWW: http://www.pacemicro.com/

begin 644 syslog.patch,fff
M26YD97 at Z('-Y<VML;V=D+T-O;F9I9RYI;@H]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]"E)#4R!F:6QE.B`O=F%R+V-V<R]B=7-Y8F]X+W-Y<VML;V=D+T-O;F9I
M9RYI;BQV"G)E=')I979I;F<@<F5V:7-I;VX@,2XR"F1I9F8 at +6(@+7<@+74@
M+7(Q+C(@0V]N9FEG+FEN"BTM+2!S>7-K;&]G9"]#;VYF:6<N:6X),C@@1F5B
M(#(P,#,@,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#$Q($!`"B`C97)R;W(@4&QE
M87-E(&1I<V%B;&4 at 0T].1DE'7T9%05154D5?25!#7U-94TQ/1PH@(V5N9&EF
M"B`**R-I9B!#3TY&24=?1D5!5%5215])4$-?4UE33$]'7T)51D9%4E]325I%
M(#P at -`HK(V5R<F]R(%-O<G)Y+"!Y;W4@;75S="!S970@=&AE('-Y<VQO9V0@
M8G5F9F5R('-I>F4@=&\@870@;&5A<W0 at -$M"+ at HK(V5R<F]R(%!L96%S92!C
M:&5C:R!#3TY&24=?1D5!5%5215])4$-?4UE33$]'7T)51D9%4E]325I%"BLC
M96YD:68**PH@(VEN8VQU9&4@/'-Y<R]I<&,N:#X*("-I;F-L=61E(#QS>7,O
M<V5M+F@^"B`C:6YC;'5D92`\<WES+W-H;2YH/@I`0"`M,3$S+#@@*S$Q."PX
M($!`"B`*('-T871I8R!I;G0@<VAM:60@/2`M,3L)+R\@:7!C('-H87)E9"!M
M96UO<GD@:60*('-T871I8R!I;G0@<U]S96UI9"`]("TQ.PDO+R!I<&,@<V5M
M87!H;W)E(&ED"BUI;G0 at 9&%T85]S:7IE(#T@,38P,#`["2\O(&1A=&$@<VEZ
M90HM:6YT('-H;5]S:7IE(#T@,38P,#`@*R!S:7IE;V8H*F)U9BD["2\O(&]U
M<B!B=69F97(@<VEZ90HK<W1A=&EC(&-O;G-T(&EN="!D871A7W-I>F4@/2`H
M*$-/3D9)1U]&14%455)%7TE00U]365-,3T=?0E5&1D527U-)6D4I*C$P,C0I
M("T@<VEZ96]F*"IB=68I.PDO+R!D871A('-I>F4**W-T871I8R!C;VYS="!I
M;G0@<VAM7W-I>F4@/2`H*$-/3D9)1U]&14%455)%7TE00U]365-,3T=?0E5&
M1D527U-)6D4I*C$P,C0I.PDO+R!O=7(@8G5F9F5R('-I>F4*('-T871I8R!I
C;G0 at 8VER8W5L87)?;&]G9VEN9R`]($9!3%-%.PH@"B`O*@H*
`
end



More information about the busybox mailing list