mirror_corosync/tools
Fabio M. Di Nitto 9a94d633cf flight recorder: switch from int to bytes for requested allocation
The flight recoder buffer size as specified in LOGSYS_DECLARE_SYSTEM
or _logsys_rec_init was expressed in number of ints. A developer asking
to allocate 512K would get a 2M allocation on a machine with sizeof(int) = 4.

This is confusing and the patch addresses it:

- rename rec_size to fltsize for external API (no type change),
  because rec_size is used many times internally for other reasons
  and it can be confusing.

- rename size to fltsize in _logsys_rec_init.

- document what we allocate and why.

- swap comments around to match the code.

- introduce a simple macro to perform rounding (stolen from linux-2.6.git).

- start shaping fdata header to better handle dynamic values:
  * write the flt_data_size as first unsigned int the header.
  * change corosync-fplay to read the value and alloc the right amount
    of memory instead of hardcoding it again.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2255 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 17:40:41 +00:00
..
corosync-cfgtool.c Fix corosync-cfgtool -a so that it actaully produces some output! 2009-06-10 07:33:19 +00:00
corosync-fplay.c flight recorder: switch from int to bytes for requested allocation 2009-06-18 17:40:41 +00:00
corosync-keygen.c Make /etc/corosync/corosync.conf default configuration file 2009-06-12 10:22:32 +00:00
corosync-objctl.c don't include <signal.h> when it's not used 2009-05-18 16:41:46 +00:00
corosync-pload.c don't include <signal.h> when it's not used 2009-05-18 16:41:46 +00:00
Makefile.am Fix coroipcc linking 2009-06-01 08:46:10 +00:00