Commit Graph

342 Commits

Author SHA1 Message Date
Jan Pokorný
37b4e73a27 Typo fix + qb blackbox(8) tweaks and extension + gitignore follow-up (#262)
* Fix typo: occur{ -> r}(ed|ing)

* doc: qb-blackbox(8): cosmetic touches

* doc: qb-blackbox(8): add "Portability notes" subsection

* Low: build: git-ignore build-aux/release.mk "overhead" files
This should have been part of ae5138d.

* build: release.mk: ensure checksum file generated even w/o signing
This should have been part of d20e48a.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-08-07 10:21:25 +01:00
Jan Pokorný
ef4c3a15ea Doc tweaking (#261)
* Fix typo: p{rr -> r}ocess
* doc: qbrb.h: several fixes to punctuation
* doc: qbrb.h: reindent example writer's error label as per reader
* doc: qbhdb.h: explain former importance to libqb itself
* doc: ipcc.c: explain why client would timebox recv from server
          Also refer to commit d633b4e.
* doc: qblog.h: minor stylistic/doxygen markup cosmetics
* doc: qblog.h: note qb_log_format_set vs. fork interaction wrt. PIDs

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-07-20 15:21:51 +01:00
Jan Pokorný
833298e265
Fix typo: repeat{ivi -> ed}ly
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-06-08 12:32:22 +02:00
Ferenc Wágner
27d9b3b829 Fix typos: synchonization -> synchronization, paramaters -> parameters 2016-12-08 14:10:55 +01:00
Ferenc Wágner
e0550bfe40 Imported Upstream version 1.0.1 2016-12-04 20:53:34 +01:00
Jan Pokorný
d107a2ab3b
Low: further sanitize qbipc[cs].h public headers wrt. includes 2016-10-17 17:41:37 +02:00
Jan Pokorný
ab78f2a4fd
Low: sanitize import of <poll.h> symbols 2016-10-17 17:39:09 +02:00
Jan Pokorný
c1c26c94cb
Low: sanitize import of <qb/qbarray.h> symbols 2016-10-17 17:25:50 +02:00
Jan Pokorný
b7f6dae97a
Fix typos: availabi{l -> li}ty, explici{lt -> tl}y 2016-10-12 20:10:22 +02:00
Jan Pokorný
d2b15efe60
Fix typo: asyncronous -> asynchronous 2016-09-30 14:26:15 +02:00
Ferenc Wágner
d7aaae8497 docs: qbdefs.h: description must directly follow @file
If we want to see it again in the man page NAME section, where it can
be indexed by apropos or whatis.
2016-07-31 14:03:34 +02:00
Jan Pokorný
bf3abb45c1
Fix typo: qblog.h: q{g -> b}_log_filter_ctl 2016-06-29 13:25:06 +02:00
Ferenc Wágner
c222171511 Imported Upstream version 1.0 2016-06-18 14:33:26 +02:00
Chrissie Caulfield
907e49b999 Merge pull request #213 from liu4480/master
low:fixed:Spelling error of failure in qbhdb.h
2016-06-06 09:49:38 +01:00
bin.liu
afcdcba16c low:fixed:Spelling error of failure in qbhdb.h
There are spelling error in include/qb/qbhdb.h, "failure" is
wroten as "faliure"
2016-06-06 09:49:29 +08:00
Jan Pokorný
5accb7ae8c
API: header-based versioning: s/PATCH/MICRO
Under the influence of libxml2 and considering that actual "patch"
information in fact, if significant, ends up encoded in QB_VER_REST,
shift away from convention codified, e.g., by semver.org (not adored
by libqb, anyway) and rename designated PATCH component of the version
to MICRO accordingly.

Note that at this point, after a release without any header-based
versioning present and just a few commits after it was tentatively
introduced, it's a painless change.  Once this PATCH nomenclature
is leaked into a full release, there's no way to get rid of it
reasonably...
2016-04-18 19:08:28 +02:00
Jan Pokorný
137b3dea5b
API: introduce alternative, header-based versioning
Mainly as a light-weight alternative to full-blown autoconf/pkg-config
machineries, whereby one can:

* workaround functionality not present in libqb up to 1.0 (inclusive)
  - note that this versioning schema is being introduced *after*
    1.0.0 release so one cannot tell that version from any older,
    but will be able to safely identify any later one (1.0.1+)
    and act accordingly
  - example:
  #if !defined(QB_VER_MAJOR) || ((QB_VER_MAJOR == 1) && (QB_VER_MINOR < 1))
  #warning "Feature X not supported"
  int do_foo(int arg) { };
  #else
  int
  do_foo(int arg)
  {
      /* use feature X of libqb */
  }
  #endif

* make its program report libqb API version it was built with by
  emitting QB_VER_STR symbolic string (see tests/print_ver.c for example)

Also added is a print_ver test program to:

* emit how original unparsed version is parsed to particular components
  defined in qbconfig.h (QB_VER_{MAJOR,MINOR,PATCH} symbolic integer
  constants and QB_VER_REST symbolic string) when being compiled

* emit mentioned QB_VER_STR symbolic string joining the components
  back to a single string, plus the components themselves

Resolves: https://github.com/ClusterLabs/libqb/issues/186
2016-04-01 23:19:40 +02:00
Chrissie Caulfield
67af307953 Merge pull request #196 from jnpkrn/demystify-qblog.h
Low: explain mysterious lines in a public header (qblog.h)
2016-04-01 16:01:14 +01:00
Jan Pokorný
28341438f4
build: make the code splint-friendly where not already 2016-03-17 15:13:58 +01:00
Jan Pokorný
cef7cab1eb
docs: enhance qb_log_ctl* description + fix doxygen warning 2016-03-17 13:26:17 +01:00
Jan Pokorný
9107af6fce
build: include: fix extra trailing newline 2016-03-10 22:44:49 +01:00
Jan Pokorný
9d696f5f5a
Low: further avoid magic in qblog.h by using named constants
Also advise to use these constants and obey this in the internal code.
2016-03-04 14:55:52 +01:00
Jan Pokorný
9b6783568a
defs: add wrappers over preprocessor operators 2016-03-04 14:54:08 +01:00
Jan Pokorný
c148444d20
Low: explain mysterious lines in a public header (qblog.h)
Also fix the previous inversion of the expression that in fact did not
use to check for anything (for "assert(1)" being a NOOP).
2016-03-04 14:51:57 +01:00
Chrissie Caulfield
7b9b72e690 Merge pull request #181 from jnpkrn/log-target-slot-enum
log: enum qb_log_target_slot introduction + qblog.h cleanup
2016-02-22 09:45:32 +00:00
Jan Pokorný
642f74de61
Feature: allow changing the identifier for syslog (+tests)
Original "qb_log_ctl" interface had to be extended for passing read-only
strings (new parameter), resulting in new "qb_log_ctl2" function, which
is what qb_log_ctl calls into with the new parameter set to NULL.
This ensures backward compatibility.

A new QB_LOG_CONF_IDENT configuration directive for the mentioned
interface is added with a goal to set new internal identifier
that is, notably, used for syslog sink.  This allows for switching
the identification without a need to reinitialize logging subsystem,
akin to changing target logging facility.

Also a brand new concept of testing syslog sink in particular is
introduced (finally).  During initial trial&error stage, it used
LD_PRELOAD hack but it seems that libtool is sophisticated enough
that no such extra intervention is needed and the desired symbol
resolution Just Works (tm).  However, the technique is highly
non-portable (there is even a warning about that from libtool,
which is partially on purpose as the _syslog_override.so should
rather be explicit it is by no mean a regular library) and hence
the syslog tests have to be enabled with explicit

    ./configure --enable-syslog-tests

rather than possibly break on untested platforms (far too many).
The concept can be extended upon, but initially, just the new
feature is being tested.

Post-review: thanks Chrissie for a suggestion how to deal with
extract-arg-and-forget in a less intrusive way (no defines).
2016-02-18 11:30:14 +01:00
Jan Pokorný
837108b02a
qblog.h: fix typos and make stylistic enhancements 2016-02-16 18:10:10 +01:00
Jan Pokorný
78d5d1686a
qblog.h: unify descriptions before the code examples
- use semicolons at the end of the description
- use commas when there can be an issue with parsing a long sentence
  (and wrap such text at 79 characters if applicable)
2016-02-16 18:08:46 +01:00
Jan Pokorný
807c7dc34a
log: better (fixed) documentation for funcs returning "slot" index
Also add missing "stdout" to the enumerations of the static ones.
2016-02-16 18:06:52 +01:00
Jan Pokorný
4ccca4bda9
log: convert log target defined values into enum values
Also use the new enum qb_log_target_slot type in for-loops together
with a proper substitute for the literal "0" initializer.

There could be more places that might be type-substituted for this enum
(and hence possibly catch more of an incorrect usage if the compiler
or checker has some notion of enum type narrowing), but leave it as
a possible enhancement for now.
2016-02-16 14:49:02 +01:00
Jan Pokorný
e74214b79b
log: defined value as an index-pointer after static slots
Amongst other uses, this allows for better (fixed) documentation
regarding how many additional logging targets the user can define.
2016-02-16 14:48:06 +01:00
Jan Pokorný
736e2c8153
includes: format __attribute__ func. annotations in qblog.h
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2016-02-03 15:40:36 +01:00
Christine Caulfield
0f62ddb76f includes: Fix format string
The format strings for QB_HDB_D_FORMAT & QB_HDB_X_FORMAT had no spaces
between "%" and PRIx64. This is allowed, but technically incorrect and
breaks C++11

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-01-08 11:25:02 +00:00
Adrian Vondendriesch
d18d1f1578 Imported Upstream version 0.17.2.real 2015-09-22 10:27:02 +02:00
Christoph Berg
37c156628d Imported Upstream version 0.17.2 2015-09-07 15:07:05 +02:00
Ken Gaillot
dc1311f05e Feature: Implement "extended" logging using a marker character
If a log message contains a magic character, everything after that marker
will be considered "extended" information. Log targets default to showing
this extended information but qb_log_ctl() may be used to indicate that
the extended information should be stripped instead.

The use case is a log message that has some information of value to administrators
and other information that is only of value for debugging. Two targets can be
configured such that the administrator log is not cluttered with debug information,
but a separate debug log is still available with complete information.

The magic character is the bell (\a). If someone wants to log an actual bell
character, they can do so in the extended information or via a %c format
(only the first bell is magic and only in the format string).
2015-04-30 12:14:53 -04:00
Ferenc Wágner
2dea3ddb8b Fix description of qbutil.h
The too early @author field stopped Doxygen from interpreting it.
2015-04-20 16:13:00 +02:00
Ferenc Wágner
75574d3b2c Add Doxygen description for qbipc_common.h
The generated manpage lacked the whatis/apropos text in the synopsis.
2015-04-20 16:12:57 +02:00
Ferenc Wágner
c95e3fae5f Fix comment typo: neccessary -> necessary 2015-04-20 16:12:56 +02:00
Ferenc Wágner
4fbef9b74b Fix comment typos: incomming -> incoming 2015-04-20 16:12:56 +02:00
Christoph Berg
2b262fd5db Imported Upstream version 0.17.1 2015-04-18 19:34:38 +02:00
Christoph Berg
e75dad6d2d Imported Upstream version 0.17.0 2015-04-18 12:01:27 +02:00
Christoph Berg
53089e7e95 Imported Upstream version 0.16.0 2015-04-18 12:01:25 +02:00
Christoph Berg
284f95ea30 Imported Upstream version 0.14.4 2015-04-18 12:01:25 +02:00
Christoph Berg
296e33b732 Imported Upstream version 0.14.3 2015-04-18 12:01:24 +02:00
Christoph Berg
8da8cdf17a Imported Upstream version 0.14.2 2015-04-18 12:01:23 +02:00
Christoph Berg
85f75e9d49 Imported Upstream version 0.11.1 2015-04-18 12:01:21 +02:00
David Vossel
eb7d6c5455 Low: qbipcs.h: fix doxygen comments for ipcs buffer size enforcement 2014-08-21 12:12:05 -05:00
David Vossel
073f927801 Low: log: return filter type enum to preserve abi compatibilty with corosync
This returns abi compatiblity with libqb v0.16.0. There was a subtle
change in behavior caused by reordering the log filter enum in
v0.17.0.
2014-07-23 14:42:27 -05:00
David Vossel
bd48e8f264 Low: doc: Add better documentation on thread-safe logging 2014-07-23 12:46:41 -05:00
David Vossel
16855e5058 Low: ipcs: Clarifications to the ipcs server callback documentation. 2014-01-07 14:22:46 -06:00
David Vossel
c3b41435b4 Merge pull request #99 from davidvossel/regex_logger
Regex logging filters
2013-11-18 10:20:03 -08:00
David Vossel
8bd36d3e5c Feature: New api function to retrieve client buffer size
When server side buffer limits are in use, this is
necessary to determine the buffer size the server
is enforcing after the client connection is established.
2013-11-18 16:53:39 -06:00
David Vossel
9f6e4bb52d Feature: Enforce buffer size limits on the server side 2013-11-18 16:51:31 -06:00
David Vossel
bfafdaeaf5 Feature: Filter logs using regex patter on function, format, or filename 2013-11-15 22:30:00 -06:00
David Vossel
00082df49f Low: blackbox: Abort blackbox logging on ringbuffer overwrite reclaim error 2013-10-08 21:59:59 -05:00
David Vossel
2b11b783c7 High: ipcs: Api function allowing server to retrieve client connection's ipc buffer size 2013-10-08 17:11:53 -05:00
David Vossel
65d044be18 High: ipcc: Add abilty to verify dgram kernel buffer size meets max msg value 2013-07-19 18:51:59 -05:00
David Vossel
75b22a20c8 Low: qbipcs.h: update ipcs connection iterator documentation 2013-07-02 18:55:08 -05:00
David Vossel
abdf8cd94a Simplify internal ipcs ref counting, add comments and document api behavior 2013-06-28 20:27:02 -05:00
Michael van der Westhuizen
652766c002 Add a IPC service context pointer and accessors from both the connection and service level. 2013-05-25 22:57:53 +01:00
Angus Salkeld
c445c06620 Properly discover SO_NOSIGPIPE and MSG_SIGNAL
bug #57
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-03-12 21:13:47 +11:00
Angus Salkeld
c77c0a98ef list: don't splice empty lists onto the head.
fixes bug #56

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-03-07 16:48:41 +11:00
Takeshi MIZUTA
4d1a98ad76 Unify to QB_TRUE/QB_FALSE a boolean value 2013-01-11 02:01:06 +09:00
Takeshi MIZUTA
96e504f305 Unify the list processing with qb_list function 2013-01-09 02:04:20 +09:00
Angus Salkeld
5e955579cb array: add a mechanism to get a callback when a bin is allocated
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:31:47 +11:00
Виноградов Василий
f44efc4529 Get libqb building on cygwin.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-07 09:14:07 +10:00
Angus Salkeld
c7810b38b1 Remove IPC_NEEDS_RESPONSE_ACK and turn off shm ipc on solaris
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 14:53:38 +10:00
Angus Salkeld
a55554efb1 LOG: change qb_vsprintf_serialize() into qb_vsnprintf_serialize()
This is to prevent overwriting the ringbuffer.
Also remove stpcpy() as it is not used anymore.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 21:40:40 +10:00
Angus Salkeld
873e467cf8 Cleanup the checks for pshared semaphores
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 10:22:56 +10:00
Angus Salkeld
22569f51ba Add user control of the permissions that are set on the shared mem files
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-13 08:21:09 +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
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
4208a4b88b Add replacement function stpcpy
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 19:10:13 +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
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
908bdfd172 IPC: add a new function to get (and alloc) the extended stats.
This should handle any further additions to the stats
as the library allocs the struct.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 20:20:29 +10:00
Angus Salkeld
c221922291 Revert "Add the event queue length to the connection stats."
This reverts commit 6b7da3f531.
2012-05-10 16:09:48 +10:00
Angus Salkeld
8ed5f55990 Cleanup the .gitignore files
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-09 21:43:58 +10:00
Angus Salkeld
916440d08d Remove HZ and use sysconf instead.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-09 21:38:38 +10:00
Angus Salkeld
259021414a SUN_LEN() macro is present if __EXTENSIONS__ is defined on Illumos
A bit reworked but originally from Igor Pashev:
84c47f8160

Note: __EXTENSIONS__ also defines _GNU_SOURCE, so removing it as well.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-09 21:37:04 +10:00
Angus Salkeld
6b7da3f531 Add the event queue length to the connection stats.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-01 13:22:16 +10:00
Angus Salkeld
b29326a363 IPC: add a is_connected client side function.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-01 12:43:22 +10:00
Angus Salkeld
154ccabdb5 docs: clarify the need to use request/response headers
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-01 12:14:58 +10:00
Angus Salkeld
1af214d91d Try and improve the portability on bsd variants.
Also add a QB_IPC_NATIVE type that selects the best ipc type available.

Signed-off-by: Angus <angus@anguss-mac-mini>
2012-03-24 22:43:37 +11:00
Angus Salkeld
d327ef7928 LOG: expose the mechanism to get a dynamic callsite.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-05 16:11:30 +11:00
Angus Salkeld
002f009941 Remove timerfd usage and go back to timelist.
timefd is using too much cpu and it is using up
file descriptors.

timelist is also more portable and now I have less
code to maintain.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-24 11:40:45 +11:00
Angus Salkeld
e37f801170 LOOP: add qb_loop_timer_is_running()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-22 11:08:42 +11:00
Angus Salkeld
446700aa66 LOOP: fix doxygen parameter comment
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-20 14:46:43 +11:00
Angus Salkeld
4dbfebbdbc LOG: add stdout target
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-20 14:46:43 +11:00
Angus Salkeld
70f1eb8130 LOOP: add a function to delete jobs
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-15 22:18:43 +11:00
Angus Salkeld
32fed9540a LOG: remove an old/incorrect doxygen comment.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-15 17:35:24 +11:00
Angus Salkeld
504e000cb8 LOG: add a hostname %H format specifier.
This is useful when logging to file on a cluster.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-15 17:34:45 +11:00
Angus Salkeld
ff0d89721f LOG: Add qb_log_filter_fn_set()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-15 15:40:58 +11:00
Angus Salkeld
7a6382f0b6 Use safer versions of string functions (strcpy -> strlcpy)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-08 22:00:49 +11:00
Angus Salkeld
ad4efc2005 LOG: pass the result of qb_log_thread_start() back to the user
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-03 14:37:37 +11:00
Angus Salkeld
63bdfd1b71 Add a split timer to the stopwatch.
This is just a re-work of Steve's sample patch.

You set the number of splits and whether they overwrite using
qb_util_stopwatch_split_ctl().

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-01 13:46:27 +11:00
Angus Salkeld
f6c5c5179d Deprecate qb_util_set_log_function()
And remove uses of it from the test programs

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-24 16:00:05 +11:00
Angus Salkeld
2f99276d16 IPC: add a context to the client interface
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-18 15:24:34 +11:00
Angus Salkeld
2d3d3eaae0 Make all headers self standing
So the user does not have to include any required headers.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-16 22:21:03 +11:00