Commit Graph

703 Commits

Author SHA1 Message Date
Andrew Beekhof
bb2e307241 LOG: Gracefully fail when the caller exceeds QB_LOG_MAX_LEN 2012-06-07 14:41:03 +10:00
Andrew Beekhof
9b0bb4e80e LOG: Observe field widths when serializing string arguments 2012-06-07 14:40:34 +10:00
Angus Salkeld
3369581066 RB: use the same mechanism in reclaim as read/peek to detect end-of-ring
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-07 12:02:32 +10:00
Angus Salkeld
cec82e0117 Add needs_response_ack option to ./check
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 16:23:41 +10:00
Angus Salkeld
9520fc4501 RB: fix wrong sem_flg IPC_NOWAIT option
The #ifdef was the wrong way around causing
the sem to return early with EAGAIN.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 16:22:58 +10:00
Angus Salkeld
b7ee2e9e6d TESTS: fix warning about unused functions
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:50:19 +10:00
Angus Salkeld
86db616209 Remove D_FORTIFY_SOURCE from check.
Can't seem to get this to work on F17.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:49:29 +10:00
Angus Salkeld
194b93678f Open shared mem file in /dev/shm only for linux
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:31:51 +10:00
Angus Salkeld
c0f52fb5c2 Don't use msg_flags on solaris (recvmsg).
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:29:10 +10:00
Angus Salkeld
e4d33aba40 Turn off attribute_section on solaris
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:26:15 +10:00
Angus Salkeld
ad05e6323d ipc example: add -e (events) option
use events instead of responses

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:08:04 +10:00
Angus Salkeld
73731f0643 IPC: if the server returns EAGAIN or ETIMEOUT the check the connection
Mainly useful for shm, as the ringbuffer doesn't know the state
of the connection.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 13:46:58 +10:00
Angus Salkeld
b52f2e37b3 LOG: make it possible to fsync() on each file log.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-05 12:07:35 +10:00
Angus Salkeld
460cc70a8b IPC: make sure that the created callback happens before dispatches
This only happened on the socket ipc type.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-04 21:45:28 +10:00
Angus Salkeld
9956fe29ff LOG: fix the printing of %p in the blackbox
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-04 14:54:39 +10:00
Angus Salkeld
1e81530332 IPC: On bsd's use the notifier for responses
The point of this is to catch connection failures
more reliably.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-01 11:12:44 +10:00
Angus Salkeld
44f61b23bb IPC: interpret ECONNRESET and EPIPE as ENOTCONN
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-01 10:15:36 +10:00
Angus Salkeld
35a4421d23 cleanup some warnings
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-31 22:18:04 +10:00
Angus Salkeld
2f4fa09b1c config: use newer AC_COMPILE_IFELSE()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-31 22:08:16 +10:00
Angus Salkeld
9f90b16d06 blackbox: fix %p formatting
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 23:16:49 +10:00
Angus Salkeld
d280ddd6e4 LOG: put all fields in the blackbox (added priority and tags)
Fixes #36

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 22:23:22 +10:00
Angus Salkeld
ca9fbe0246 example: make the priority uint8_t
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 21:51:13 +10:00
Angus Salkeld
33b582aad7 Remove strerror out of check_funcs
We only use strerror_r

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 19:14:21 +10:00
Angus Salkeld
85b39906a9 RB: fix compiler warning.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 19:10:13 +10:00
Angus Salkeld
4208a4b88b Add replacement function stpcpy
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 19:10:13 +10:00
Angus Salkeld
369e2614a9 Add missing AC_TYPE_UINT16_T to configure.ac
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 14:44:19 +10:00
Angus Salkeld
fe8014b379 Use AC_FUNC_STRERROR_R and STRERROR_R_CHAR_P
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 14:41:43 +10:00
Angus Salkeld
76582618cf Add stpcpy strcasecmp to the check_funcs
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 14:33:46 +10:00
Angus Salkeld
2b49dc7030 Move some conditional defines into code (from the configure script)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 14:33:03 +10:00
Angus Salkeld
847741c853 Remove some unused configure checks
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 14:31:02 +10:00
Angus Salkeld
70a9623a48 Remove message queues
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 13:41:04 +10:00
Angus Salkeld
aaae0a3c31 Check for union semun properly
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 13:35:48 +10:00
Angus Salkeld
531f7cdb7a Blackbox: provide more space for log messages when reading from the blackbox.
This is to allow for the header (16bytes and variable length function).
so if someone has a function name > 400 chars it will break. I
recon that will do:)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 13:34:15 +10:00
Andrew Beekhof
d670515da1 Add the blackbox reader manpage to the spec file 2012-05-28 12:49:01 +10:00
Andrew Beekhof
68b56a8eb5 Enable error logging for the blackbox reader 2012-05-28 12:35:28 +10:00
Andrew Beekhof
77fa3650dd RB: Read the file size into an initialized variable of the correct size 2012-05-28 12:25:10 +10:00
Angus Salkeld
c41f2c93a0 Add a tool to dump the blackbox.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 11:16:00 +10:00
Angus Salkeld
e0bc3a15ce RB: to be safer save the read and write pointers at the top of the blackbox
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-25 14:01:19 +10:00
Jim Meyering
32abe38ffd avoid unwarranted use of strncpy: use memcpy instead
* lib/log_format.c (qb_vsnprintf_deserialize): We know that there are
len or more non-NUL bytes in the source string, so it's clearer to
use memcpy.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 20:47:57 +10:00
Angus Salkeld
a8405ab06d blackbox: fix the print_from_file()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 19:22:55 +10:00
Angus Salkeld
4fdabe5bed RB: add an option to not use any semaphores
(brought over from the "speed" branch)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 19:16:59 +10:00
Angus Salkeld
0327b6aa86 LOG: tweak the blackbox format string
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 14:37:05 +10:00
Angus Salkeld
c56427e19e LOG: accept NULL strings into the blackbox
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 14:16:54 +10:00
Angus Salkeld
072e224331 LOG: protect close and reload from calling log
Logging during these operations is temporarly disabled.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 13:06:51 +10:00
Angus Salkeld
257897e38a Add benchmark option (-b) to examples/ipcclient
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-21 08:34:59 +10:00
Angus Salkeld
7bf88478ac TEST: make rbreader/writer more like the other benchmarking apps
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-21 08:30:22 +10:00
Angus Salkeld
0458c5ccd2 IPC: log the connection description in all logs
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-16 13:59:12 +10:00
Angus Salkeld
0256284338 TEST: re-organise the ipc test suites
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-16 13:32:13 +10:00
Angus Salkeld
78374c2ed3 IPC: only modify the dispatch if we get EAGAIN
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-16 13:19:41 +10:00
Jan Friesse
a4411105a7 Correctly display timestamp in blackbox
On little endian architectures where time_t is 64-bit long integer could
happen, that instead of displaying correct timestamp, random data was
used, because of memcpy.

Solution is to memcpy to real 32-bit variable and then assing this value
to timestamp. This will let compiler decide endianity and store number
correctly.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-12 22:04:59 +10:00