Commit Graph

152 Commits

Author SHA1 Message Date
Виноградов Василий
c3688ab19c Provide some helpful macros for iterating over lists.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-27 20:43:51 +10:00
Angus Salkeld
7ffd10326a Correct the declarations of some inlines
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-26 10:42:15 +10:00
Angus Salkeld
ebe8cd7008 Add support for ansi inline and typeof
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-26 10:41:06 +10:00
Angus Salkeld
048edde19c LOG: add custom targets
This is partly to make the tests more robusts and
to add some more flexibility to the logging.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-23 20:28:18 +10:00
Angus Salkeld
943b1c646b fix the FIXME's Jim pointed out
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-18 11:11:14 +10:00
Angus Salkeld
acf8c0e94f LOG: make the "entering" and "leaving" capital
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-13 10:05:12 +10:00
Angus Salkeld
2a83aa8dfe LOG: add an enter and leave trace function
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-06 10:54:20 +10:00
Angus Salkeld
46102fe43a LOG: include needed stdio.h
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-18 22:54:13 +10:00
Angus Salkeld
6f73dd2993 LOG: make all priorities uint8_t
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-18 22:54:13 +10:00
Angus Salkeld
ea2d5d4058 Add qbconfig.h to the list of headers to be installed.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 22:23:01 +10:00
Angus Salkeld
b7e83fd3b2 LOG: add dynamic callsites (for platforms that don't support __attribute__(section)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 16:05:38 +10:00
Angus Salkeld
4de5ff927f ARRAY: add getter's to retrieve number of bins and elms/bin
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 09:55:57 +10:00
Angus Salkeld
568befd3f1 LOG: add LOG_TRACE
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-12 22:21:57 +10:00
Angus Salkeld
78541f5198 LOG: add the ability to adjust the priority sent to syslog()
If you have:
qb_log_filter_ctl(QB_LOG_SYSLOG, QB_LOG_FILTER_ADD,
		  QB_LOG_FILTER_FILE, "hack.c", LOG_DEBUG);
these logs will not make there way to /var/log/messags
without reconfiguring syslog.

So to help on the fly debugging do the following:
qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_PRIORITY_BUMP,
	   LOG_INFO - LOG_DEBUG);

Now all messages that have the QB_LOG_SYSLOG target set
will have their priority bumped before going to syslog().

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-12 22:20:50 +10:00
Angus Salkeld
58697dbcc6 LOG: change the target type from uint32_t to int32_t.
This is so that you won't get warnings from mixing integer types.

I have updated the input checks in log.c to check for invalid
targets.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-09 23:11:44 +10:00
Angus Salkeld
249546a9e7 LOG: teach filter_ctl() to write tags
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-06 22:27:53 +10:00
Angus Salkeld
b5d27ad250 LOG: remove the tags arument from qb_log() and add qb_logt() which has the tags argument.
I think in most cases tags will not be used and it will
just be a pain inserting ", 0". But if someone wants to use
tags like this then they still can via qb_logt()

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-06 22:27:41 +10:00
Angus Salkeld
9aa50b2ece LOG: fix shared library callsites
This finds all the callsites in shared libraries
(using dl_iterate_phdr()) at the time qb_log_init()
is called.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>

Conflicts:

	lib/log.c
2011-04-06 22:09:46 +10:00
Angus Salkeld
9b18614473 LOG: add a callsite_dump() function to see what callsite are avaliable.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-06 22:06:01 +10:00
Angus Salkeld
aefae42937 LOG: support dynamically loaded modules
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-06 21:41:13 +10:00
Angus Salkeld
51a1153ecb Add required include to qbloop.h
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-04 11:09:16 +10:00
Angus Salkeld
b81d75fab5 LOG: make the documentation more meaningful
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-01 22:42:43 +11:00
Angus Salkeld
7f0d983f49 LOG: add a qb_log_fini() to cleanup
This replaces qb_log_thread_stop() but also release shared mem

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-01 14:50:51 +11:00
Angus Salkeld
e390613036 LOG: fix mapping from priority to name
Remove qb_log_priority_name_get() as we have the
formatting.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-31 21:38:08 +11:00
Angus Salkeld
191b71a8b7 LOG: add a new "tags" field
this is a tags that is used by the caller to:
- define the message as an external message (needs free'ing)
- define a feature or susbsytem that can be printed in the log message.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-31 21:37:44 +11:00
Angus Salkeld
9d159ab87f LOG: change "tags" field to "targets"
This is it's new meaning, so makes things clearer

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-31 21:33:37 +11:00
Angus Salkeld
34ee74db55 LOG: add a format option to each target.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 23:06:41 +11:00
Angus Salkeld
764fd0284b LOG: improve the docs
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 21:33:07 +11:00
Angus Salkeld
da28f16dd8 LOG: add qb_log_file_close()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 21:22:27 +11:00
Angus Salkeld
2836e5bcf9 LOG: add the ability to import logs from other sources.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 21:17:50 +11:00
Angus Salkeld
1a9c549eb5 Be more consistent with the C++ protection
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 19:53:41 +11:00
Angus Salkeld
32817adb15 LOG: re-work the API to be easier to use.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-30 11:46:36 +11:00
Angus Salkeld
dd4d21472c LOG: add qb_log_priority_name_get()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-28 12:25:26 +11:00
Angus Salkeld
04b76a0f27 LOG: fix make install and distcheck
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-28 12:25:06 +11:00
Angus Salkeld
3452d162d2 LOG: add a qb_perror() function
- Add an internal version too
- Update the library code to use it.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-28 11:12:47 +11:00
Angus Salkeld
2956f9ef29 LOG: add a timestamp to the log handler
This makes sure that the timestamp is correct at the time
the call to qb_log() was called.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-27 22:57:58 +11:00
Angus Salkeld
6eddcfc26e LOG: split the tag function out into tag and untag
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-27 22:03:33 +11:00
Angus Salkeld
fcf4ddfd59 LOG: improve the doxygen overview.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-27 21:56:59 +11:00
Angus Salkeld
a215e856d8 LOG: fix splint warnings
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-27 21:01:11 +11:00
Angus Salkeld
f86c96bee1 LOG: add a blackbox
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-25 23:40:53 +11:00
Angus Salkeld
5bddb0fe68 LOG: add threaded logging (non-blocking)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-25 23:35:35 +11:00
Angus Salkeld
e910f8bc18 Add logging infrastructure.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-25 23:34:12 +11:00
Angus Salkeld
3c742eb761 DOCS: add missing @param on new timeout argument
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-09 17:23:45 +11:00
Angus Salkeld
8431910be0 LOOP: change timer handle from pointer to index + check.
This changes the timer hande from a live pointer to a handle
more like hdb handles (minus the ref counting).

What i like about this is it is not neccessary to clear
the applications handle using memset().

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-05 10:52:30 +11:00
Angus Salkeld
324580f5c2 LOOP: remove tlist absolute timer
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-01-05 09:21:15 +11:00
Angus Salkeld
fa892f679c RB: add a function to get the reference count.
Really handy to see if the peer is "connected".

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-12-16 22:09:52 +11:00
Angus Salkeld
43181d5a95 IPC: add a timeout to the client recv functions
Also allow the ringbuffer to pass ETIMEDOUT back to the
client applications.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-12-16 21:47:47 +11:00
Angus Salkeld
859006bb14 IPC: rename _ref_inc() to _ref()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-12-13 16:18:19 +11:00
Angus Salkeld
45ff679934 LOOP: change timers to be nano second based
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-12-13 12:23:45 +11:00
Angus Salkeld
fa72adc5be DOCS: fix some doxygen warnings for missing comments.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-12-13 10:43:35 +11:00