Commit Graph

21 Commits

Author SHA1 Message Date
Angus Salkeld
0ad2494ae7 Fix some "set but not used" warnings [-Wunused-but-set-variable]
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-03-16 07:13:42 +11:00
Jan Friesse
12163b62d2 corosync-fplay: use uint32_t and remove bit-shift
The flight recorder records all data in 32 bit words. Use uint32_t type
rather then unsigned int. Also remove bit-shift with multiply by sizeof
uint32_t.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-02-23 13:31:38 +01:00
Jan Friesse
d3e9382d57 corosync-fplay: Use size_t length mod in printf
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-02-23 13:31:31 +01:00
Jan Friesse
7b0517f5e9 corosync-fplay: handle too large rec_size
Corrupted files may contain items with rec_size larger then g_record
buffer and/or flt_data_size.

Also g_record array size is now defined as constant.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-02-22 10:11:48 +01:00
Angus Salkeld
c94dba0b49 cov 10385: assigning signed int to unsigned variable
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2828 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-14 02:07:39 +00:00
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
Fabio M. Di Nitto
6d5ce092a1 logsys: port to new packed rec_ident version
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2250 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 05:32:56 +00:00
Fabio M. Di Nitto
5597a2381f logsys: merge tags into rec_ident
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2246 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 05:15:10 +00:00
Jim Meyering
d44aad2eea don't include <assert.h> when it's not used
* exec/apidef.c: Likewise.
* exec/mainconfig.c: Likewise.
* exec/service.c: Likewise.
* exec/timer.c: Likewise.
* exec/totemconfig.c: Likewise.
* exec/totemmrp.c: Likewise.
* exec/vsf_quorum.c: Likewise.
* services/testquorum.c: Likewise.
* test/cpgbench.c: Likewise.
* test/cpgbenchzc.c: Likewise.
* tools/corosync-fplay.c: Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2192 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-18 16:41:37 +00:00
Fabio M. Di Nitto
75c9085204 Fix logsys TAG handling
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2180 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-13 03:59:47 +00:00
Jim Meyering
3081a12f18 corosync-fplay.c: don't shadow file-scoped global, "record"
* tools/corosync-fplay.c: Rename: s/record/g_record/.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2074 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-15 19:13:03 +00:00
Jim Meyering
567ea5464c corosync-fplay.c: avoid shadowin: s/index/idx/
* tools/corosync-fplay.c (printer_totempg_mcast_fits):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2072 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-15 19:12:48 +00:00
Jim Meyering
05f2a7afee remove unused file-scoped global
* tools/corosync-fplay.c (records_printed): Remove.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1985 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:34:01 +00:00
Jim Meyering
d2430bce4d avoid prototype warnings, constify
* tools/corosync-fplay.c: Make many parameters and local pointers const.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1984 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:33:49 +00:00
Jim Meyering
748cf03858 remove unused functions and variable
* tools/corosync-fplay.c (sync_printer_nada): Remove function.
* tools/corosync-objctl.c (get_child_name): Remove function.
* test/evsverify.c (msg): Remove unused variable.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1983 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:33:36 +00:00
Jim Meyering
9bd1a8e728 declare many functions "static" (also avoids missing prototype warnings)
* exec/main.c (sigintr_handler, serialize_lock, serialize_unlock):
(serialize_lock, serialize_unlock):
* exec/sync.c (sync_start_init, sync_callbacks_load):
* exec/vsf_ykd.c (ykd_state_init):
* lcr/uis.c (cmd1):
* services/pload.c (send_message, token_callback, start_mcasting):
* tools/corosync-cfgtool.c (service_load_do, service_unload_do):
(shutdown_do, showaddrs_do, killnode_do, usage_do):
* tools/corosync-fplay.c (totemip_print, print_string_len):
(sync_printer_confchg_set_sync, sync_printer_set_sync_state):
(sync_printer_process_currentstate):
(sync_printer_process_get_shouldsync):
(sync_printer_checkpoint_release):
(sync_printer_checkpoint_transmit, sync_printer_section_transmit):
(sync_printer_checkpoint_receive, sync_printer_section_receive):
(sync_printer_nada, sync_printer_confchg_fn):
(printer_totemsrp_mcast, printer_totemsrp_delv):
(printer_totempg_mcast_fits, sync_printer_service_process):
* tools/corosync-objctl.c (get_child_name, get_parent_name):
(get_key):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1980 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:33:07 +00:00
Jim Meyering
b7e9fcaa1b corosync-fplay.c: make more robust, avoid warnings
* tools/corosync-fplay.c (main): Diagnose malloc,open, and read failures

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1926 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-30 21:10:53 +00:00
Fabio M. Di Nitto
031c02f589 - Every .c file should include "config.h" to get the right defines...
- services/Makefile.am: add include search paths for config.h

- include/corosync/cs_config.h.in exports LCRSODIR and SOCKETDIR

- tools/Makefile.am: drop -D defines for dirs that are now in
cs_config.h or config.h

- configure.ac: sanitize prefix and exec_prefix paths. Export DIRS in
*config.h

- lib/Makefile.am: : drop -D defines for dirs that are now in
cs_config.h or config.h. Add rule to build lcr_ifact.o or building from
lib/ fails miserably



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1877 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-19 12:58:53 +00:00
Fabio M. Di Nitto
e8f4a4c606 remove hardcoded /var and use localstatedir
instead.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1854 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-17 09:53:39 +00:00
Angus Salkeld
fd25950970 LINT: fix or ignore unchecked return values.
If we don't care about the return value then typecase the return
value to void.
Else do something useful with the return value.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1693 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-11-11 17:25:22 +00:00
Steven Dake
0c631e24fc Logsys flight recorder.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1681 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-10-30 22:25:56 +00:00