Christian Thaeter [Sat, 29 May 2010 14:08:20 +0000 (16:08 +0200)]
FIX: context initialization, __func__ retrieval
* define NOBUG_FUNC to a language and compiler defined macro
* add detection heursistics therefor
* add C++ ctors to construct contexts, C uses struct casts
Different standards (C/C++) and implementations provide different ways to
access the function name of the current called function. We abstract that
here and provide a fallback in case no suitable way is known.
One can override it with a CFLAG -DNOBUG_FUNC="something"
Christian Thaeter [Thu, 20 May 2010 21:11:39 +0000 (23:11 +0200)]
FIX: only emit trailing semicolons in llist.h when generating declarations
Christian Thaeter [Wed, 19 May 2010 17:43:13 +0000 (19:43 +0200)]
FIX: errorcode when file does not exist is undefined, must be !0 in selftest
Christian Thaeter [Wed, 19 May 2010 16:21:02 +0000 (18:21 +0200)]
Check for existence of LOG_PERROR
Christian Thaeter [Wed, 19 May 2010 16:07:20 +0000 (18:07 +0200)]
FIX: impove generic compiler support
* remove gcc specific flags
* cast resource identifer to const void* to silence the sun cc
* fix stray comma for non gcc compilers
Christian Thaeter [Tue, 11 May 2010 22:18:59 +0000 (00:18 +0200)]
This is release 201005.1
Christian Thaeter [Tue, 11 May 2010 22:12:54 +0000 (00:12 +0200)]
prefix all mpool functions with nobug_
also bump library version
Christian Thaeter [Sun, 18 Apr 2010 20:23:14 +0000 (22:23 +0200)]
require invariant functions to be prefixed with 'nobug_'
Christian Thaeter [Sun, 18 Apr 2010 20:09:38 +0000 (22:09 +0200)]
add a 'void* extra' parameter to the INVARIANT macros
Same as the previous commit but for invariants.
Christian Thaeter [Thu, 8 Apr 2010 17:31:57 +0000 (19:31 +0200)]
add a 'void* extra' parameter to the DUMP macros
This breaks code using the dump macros, fix it by adding a void* extra to
the nobug_*_dump functions and pass NULL around.
Library compatibility is not broken.
Christian Thaeter [Thu, 4 Mar 2010 11:54:55 +0000 (12:54 +0100)]
add a PLANNED_TEST() macro to test.h
Christian Thaeter [Wed, 3 Feb 2010 09:16:09 +0000 (10:16 +0100)]
This is release 201002.1
Christian Thaeter [Tue, 2 Feb 2010 12:18:13 +0000 (13:18 +0100)]
reenable recursive resource_mutex
this allows nested state transistions
NOBUG_RESOURCE_WAIT (...)
{
lock ();
NOBUG_RESOURCE_STATE (..) ;
}
Christian Thaeter [Tue, 2 Feb 2010 12:06:45 +0000 (13:06 +0100)]
Fix testsuite for the new continutation syntax using a '!' after the event count
Christian Thaeter [Tue, 2 Feb 2010 12:05:47 +0000 (13:05 +0100)]
FIX: Rework locking
The resourcetracker macros are now block heads which protect the next
statement. Locking is coded into the Library, macros removed.
Christian Thaeter [Tue, 2 Feb 2010 11:58:00 +0000 (12:58 +0100)]
fix threadstress test, disable beta and release, these need more work
Christian Thaeter [Mon, 1 Feb 2010 08:22:03 +0000 (09:22 +0100)]
BUG: race condition when starting threads accessing resources
A resource should be registered at the resourcetracker when it becomes
available. In presence of threads there is a race condition when a
created immediately tries to access this resource. A proper solution is to
make resource operations atomic with the resourcetracker.
This commit introduces a test with the proposed syntax to be implemented in
the following commits. Using block statements again (as faulty abadoned
some time ago)
Christian Thaeter [Sat, 30 Jan 2010 22:07:47 +0000 (23:07 +0100)]
multiline continued log lines have a special event mark (!) now
instead printing something like
0000000001: first
0000000001: continued
it now prints
0000000001: first
0000000001! continued
Christian Thaeter [Sat, 30 Jan 2010 22:05:45 +0000 (23:05 +0100)]
replace certain boring strings with a '-'
Most notably for non-threaded programs the thread id is now ' -:' giving
more consistent logs
Christian Thaeter [Fri, 29 Jan 2010 07:19:14 +0000 (08:19 +0100)]
This is release 201001.3
Christian Thaeter [Fri, 29 Jan 2010 07:11:55 +0000 (08:11 +0100)]
Fix Makefile, release-tagging
Christian Thaeter [Fri, 29 Jan 2010 06:14:38 +0000 (07:14 +0100)]
use a VERSION file to track the version
Christian Thaeter [Fri, 29 Jan 2010 06:02:36 +0000 (07:02 +0100)]
Add a lot release maintenance targets to the Makefile.am
Christian Thaeter [Fri, 29 Jan 2010 04:40:35 +0000 (05:40 +0100)]
script to query the current version from the configure.ac
Christian Thaeter [Fri, 29 Jan 2010 04:39:56 +0000 (05:39 +0100)]
add library versioning
starting at 1:0:0 because all older releases didn't used versioning and
where installed as .0 versions.
Christian Thaeter [Fri, 29 Jan 2010 03:52:45 +0000 (04:52 +0100)]
Add a small script for bumping the version number
Christian Thaeter [Fri, 29 Jan 2010 03:38:59 +0000 (04:38 +0100)]
update copyright headers again
Just testing how the git-analyze-copyright works
Christian Thaeter [Fri, 29 Jan 2010 01:31:23 +0000 (02:31 +0100)]
Enable resource logging in BETA builds
.. but leave the resourcetracker ALPHA only. This is a prerequisite for
a long time goal to have an application which processes logfiles offline
and does there resourcetracking there.
Christian Thaeter [Thu, 28 Jan 2010 23:35:24 +0000 (00:35 +0100)]
add a NIL context for passing boring contexts
Christian Thaeter [Thu, 28 Jan 2010 23:28:21 +0000 (00:28 +0100)]
Add a 'guard' size parameter to ringbuffer construction, remove hardcoded
The size of ringbuffer wraparound pages at each end of the data was
hardcoded to 1 page. This remove this restriction and lets one pass
explicit sizes for this areas.
This also adds a (guard=N) option parsed from the NOBUG_LOG env var.
Christian Thaeter [Thu, 28 Jan 2010 07:30:16 +0000 (08:30 +0100)]
use multiline logging for resource_dump() and resource_list()
Christian Thaeter [Thu, 28 Jan 2010 06:45:32 +0000 (07:45 +0100)]
Refactor logging core into multiple functions, support multi-line logging
log messages can now contain newline characters '\n' to break lines.
Each such new line will emit a new logging line with the same header
(same logging event number).
This multiline logging is atomic and will not be mixed with other log
output.
The logging callback function is called for each emited line, while the
postlogging callback is still only called once after the output.
Christian Thaeter [Thu, 28 Jan 2010 06:16:57 +0000 (07:16 +0100)]
formatting fix for init_flag
Christian Thaeter [Thu, 28 Jan 2010 05:58:54 +0000 (06:58 +0100)]
ringbuffer_extend() for adding extra space to the last added entry
Christian Thaeter [Thu, 28 Jan 2010 05:52:48 +0000 (06:52 +0100)]
Ringbuffer internal doc
Christian Thaeter [Thu, 28 Jan 2010 05:50:28 +0000 (06:50 +0100)]
Some small doc fixes reflecting recent new features
Christian Thaeter [Mon, 25 Jan 2010 07:52:07 +0000 (08:52 +0100)]
Update copyright headers according to git blame output
processed with http://git.pipapo.org/git-analyze-copyright
Peter Simons told me that he doesnt claim copyright of his contributions
Christian Thaeter [Mon, 25 Jan 2010 07:33:31 +0000 (08:33 +0100)]
updated NEWS file from all previous release announcements
Christian Thaeter [Mon, 25 Jan 2010 07:32:38 +0000 (08:32 +0100)]
add .mailmap for git commit/author normalization
Christian Thaeter [Sat, 23 Jan 2010 15:58:13 +0000 (16:58 +0100)]
New README file
Christian Thaeter [Sat, 23 Jan 2010 04:53:19 +0000 (05:53 +0100)]
Documentation update for new 'context' facility. Bump version to 201001.2
Christian Thaeter [Sat, 23 Jan 2010 03:02:20 +0000 (04:02 +0100)]
Pass resource context structure directly instead pointer
Better C++ compatibility (no temporary), little more stack usage,
less pointer dereferences
Christian Thaeter [Sat, 23 Jan 2010 00:25:04 +0000 (01:25 +0100)]
context passing update
* _CTX macros for logging
* NOBUG_CONTEXT_NOFUNC to be used in static initialization, doesn't use
the __func__ symbol
* small fixes
Christian Thaeter [Fri, 22 Jan 2010 20:22:13 +0000 (21:22 +0100)]
WIP: add source contexts, remove debugger-only macros
* a 'struct nobug_context' is used to pass information about sourcefile
linenumber and function along.
* many macros have an additional *_CTX variant which takes such a context
(more to be implemented on demand)
* general refactoring to more basic cases, less code duplication,
prepare to move more things from macros to library functions.
* remove *_DBG variants which where only active when running under a
debugger, the flags mechanism provides more flexibility and
superseeded these.
* change the semantics of thread_id's, each thread gets on unique number
now which never changes. Resetting the thread identifier increments a
generation counter for the thread (currently unused)
* don't depend on gcc's ## __VA_ARGS_ semantics. Found a way to pass
""__VA_ARGS__ instead is portable, the only remaining case is
NOBUG_ASSERT_ which has a conditional fallback for other compilers
(and then don't print the failed expression anymore)
The above things are not yet in the documentation.
Christian Thaeter [Tue, 19 Jan 2010 22:43:58 +0000 (23:43 +0100)]
remove some double nobug_counter printing from resource_dump and backtrace
Christian Thaeter [Mon, 11 Jan 2010 09:52:17 +0000 (10:52 +0100)]
FIX: C++ warning about passing temporary, make the dump context explicit
Christian Thaeter [Sun, 10 Jan 2010 17:09:30 +0000 (18:09 +0100)]
Thanks to testing by Jeroen van de Nieuwenhof, MacOS X is now supported
Christian Thaeter [Sun, 10 Jan 2010 16:58:40 +0000 (17:58 +0100)]
FIX: make selftest more robust
Christian Thaeter [Sun, 10 Jan 2010 16:50:25 +0000 (17:50 +0100)]
FIX: Macos has no static initializer for recursive mutexes
Christian Thaeter [Sun, 10 Jan 2010 16:28:58 +0000 (17:28 +0100)]
FIX: mmap checking
Christian Thaeter [Sun, 10 Jan 2010 16:04:43 +0000 (17:04 +0100)]
alias for RESOURCE_TRY
Christian Thaeter [Sun, 10 Jan 2010 11:13:37 +0000 (12:13 +0100)]
RELEASE: 201001.1
Christian Thaeter [Sun, 10 Jan 2010 11:12:36 +0000 (12:12 +0100)]
Revert "NOBUG_INIT() not always required."
This reverts commit
de7e94784fda8cf02f266b60ae468ef3e112f8e8.
Conflicts:
doc/initialization.txt
Christian Thaeter [Sat, 9 Jan 2010 23:33:19 +0000 (00:33 +0100)]
add a TRYING stateto the resourcetracker
Trying the same as waiting, but does not trigger the deadlock checker.
This is to be used whenever deadlock checking is done on application level
like a timed lock or so.
Christian Thaeter [Sat, 9 Jan 2010 17:43:56 +0000 (18:43 +0100)]
test.sh cosmetics
Christian Thaeter [Sat, 9 Jan 2010 17:19:55 +0000 (18:19 +0100)]
FIX: the glibc logger using nobug_log internally, no locking needed
Christian Thaeter [Sat, 9 Jan 2010 17:06:33 +0000 (18:06 +0100)]
FIX: printing the nobug event counter was internalized to nobug_log
Christian Thaeter [Sat, 9 Jan 2010 10:35:57 +0000 (11:35 +0100)]
correct macro parameter parentizing
Christian Thaeter [Fri, 8 Jan 2010 23:21:41 +0000 (00:21 +0100)]
RESOURCE_ASSERT_STATE checks for asserting that a resource is in a given state
Christian Thaeter [Thu, 7 Jan 2010 15:01:06 +0000 (16:01 +0100)]
add sync/allsync functions to ringbuffer, sync ringbuffers before aborting
Christian Thaeter [Thu, 7 Jan 2010 14:57:07 +0000 (15:57 +0100)]
check that a thread owns no resources when changing its id
Christian Thaeter [Thu, 7 Jan 2010 08:18:03 +0000 (09:18 +0100)]
locking for backtraces
Christian Thaeter [Thu, 7 Jan 2010 08:17:43 +0000 (09:17 +0100)]
back to old semantics for resource acquisition. only LEAVE has a block
Christian Thaeter [Thu, 7 Jan 2010 08:15:12 +0000 (09:15 +0100)]
add AM_CFLAGS to test build
Christian Thaeter [Thu, 7 Jan 2010 07:23:40 +0000 (08:23 +0100)]
update the compatibility table
Christian Thaeter [Wed, 6 Jan 2010 15:52:13 +0000 (16:52 +0100)]
Merge remote branch 'plouj/master' into devel
* plouj/master:
better grammar and sentences
stop ECHO from logging to syslog
Christian Thaeter [Wed, 6 Jan 2010 15:47:29 +0000 (16:47 +0100)]
Merge branch 'von_benny' into devel
* von_benny:
Corrections, rearrangement & first sample module.
Reworked.
Michael Ploujnikov [Tue, 5 Jan 2010 00:53:18 +0000 (19:53 -0500)]
Merge remote branch 'origin/devel' into mine
Michael Ploujnikov [Tue, 5 Jan 2010 00:52:57 +0000 (19:52 -0500)]
better grammar and sentences
Christian Thaeter [Mon, 4 Jan 2010 12:19:59 +0000 (13:19 +0100)]
unlock the resource mutex before executing the users code when entering resources
waiting on resources lead to a deadlock, its enough when we keel the
resource mutex locked on leave operations.
Christian Thaeter [Tue, 22 Dec 2009 03:33:42 +0000 (04:33 +0100)]
include the name of the .test file into the ,testlog
Christian Thaeter [Tue, 22 Dec 2009 03:26:55 +0000 (04:26 +0100)]
WIP: Fix testsuite to run on armel/scratchbox
Christian Thaeter [Mon, 21 Dec 2009 19:57:05 +0000 (20:57 +0100)]
armel/gcc needs to cast ~0 to char
Christian Thaeter [Mon, 21 Dec 2009 19:32:34 +0000 (20:32 +0100)]
Add 'msg' command
Christian Thaeter [Mon, 21 Dec 2009 02:15:23 +0000 (03:15 +0100)]
remove the 'less than' version check for valgrind
Christian Thaeter [Mon, 21 Dec 2009 02:13:04 +0000 (03:13 +0100)]
FIX: forgot to make valgrind optional
Christian Thaeter [Mon, 21 Dec 2009 00:55:50 +0000 (01:55 +0100)]
refine the mmap_anon configure check, should work this way
Christian Thaeter [Mon, 21 Dec 2009 00:55:02 +0000 (01:55 +0100)]
FIX: valgrind newline semantics after 3.5.0 (partial)
valgrind 3.5.0 decided to supress the newline after a PRINTF message
the user has to supply it by himself. This adds a config test for the
version valgrind and removes the with_pkg check.
It's not clear how Backtraces are formatted, someone needs to check this
Christian Thaeter [Sun, 20 Dec 2009 19:16:43 +0000 (20:16 +0100)]
fix and use the mmap-anon.m4 macro for our purpose (untested)
Christian Thaeter [Sun, 20 Dec 2009 17:45:23 +0000 (18:45 +0100)]
some (for now enough) documenting work on test.sh
Christian Thaeter [Sun, 20 Dec 2009 00:07:26 +0000 (01:07 +0100)]
little more sane watchdog handling, interrupt and break the watchdog
when the test finished
Christian Thaeter [Sat, 19 Dec 2009 23:33:08 +0000 (00:33 +0100)]
add test.sh selftests, fix elseif
Christian Thaeter [Sat, 19 Dec 2009 21:59:22 +0000 (22:59 +0100)]
fix conditions, add 'elseif'
Christian Thaeter [Sat, 19 Dec 2009 20:47:43 +0000 (21:47 +0100)]
add literal matching in tests
Christian Thaeter [Sat, 19 Dec 2009 20:19:18 +0000 (21:19 +0100)]
support if: else: endif: conditional tests
Christian Thaeter [Sat, 19 Dec 2009 02:43:37 +0000 (03:43 +0100)]
implement LIMIT_TIME for limiting wall time (deadlocks)
I hope this doesn't break tests implemented as shell functions
(currently not used, untested)
Christian Thaeter [Sat, 19 Dec 2009 02:38:46 +0000 (03:38 +0100)]
dont need to export variables
Michael Ploujnikov [Fri, 18 Dec 2009 22:57:05 +0000 (17:57 -0500)]
Merge branch 'devel' of git://git.pipapo.org/nobug into mine
Christian Thaeter [Fri, 18 Dec 2009 21:08:47 +0000 (22:08 +0100)]
WIP: documenting and improving test.sh
Michael Ploujnikov [Fri, 18 Dec 2009 02:29:16 +0000 (21:29 -0500)]
Merge branch 'devel' of git://git.pipapo.org/nobug into mine
Christian Thaeter [Fri, 18 Dec 2009 02:01:15 +0000 (03:01 +0100)]
refactor nobug log-locking again
move the locking and post-callback back into the function.
nobug_counter is now intrinsic to the log function, uses ringbuffer_append
to complete a log message.
Christian Thaeter [Fri, 18 Dec 2009 01:58:34 +0000 (02:58 +0100)]
add a 'append' mode for the ringbuffer
the write position is stepped back by one, but not over the begin of the
last write operation, thus the next printf will append to the last message
instead create a new message entry.
Christian Thaeter [Fri, 18 Dec 2009 00:33:04 +0000 (01:33 +0100)]
Dont _exit(0) in vgsuppression
Christian Thaeter [Fri, 18 Dec 2009 00:32:23 +0000 (01:32 +0100)]
Let VALGRINDFLAGS replace defaults instead extend them
This makes it possible to run the test.sh with
VALGRINDFLAGS=--tool=helgrind
or similar
Christian Thaeter [Fri, 18 Dec 2009 00:30:49 +0000 (01:30 +0100)]
Factor log-locking out to the _LOG macro.
the logging-log needs to protect the ++nobug_counter too. Unfortunally the
postlogging callback must be moved to the macros too now. At least its more
correct this way, maybe this needs some more refactoring in future to put
this back into the logging function.
Christian Thaeter [Fri, 18 Dec 2009 00:27:15 +0000 (01:27 +0100)]
Make resource handles typessafe
This was long overdue, with the new resourcetracker we have 2 kinds of
resourcehandles. Removes all casts, introduces macros for both kinds
of resourcehandles.
Michael Ploujnikov [Thu, 17 Dec 2009 03:29:38 +0000 (22:29 -0500)]
Merge remote branch 'origin/devel' into mine
Michael Ploujnikov [Thu, 17 Dec 2009 03:27:54 +0000 (22:27 -0500)]
stop ECHO from logging to syslog
Christian Thaeter [Thu, 17 Dec 2009 00:29:38 +0000 (01:29 +0100)]
simple doc fixes (PARA's without ;;)
Christian Thaeter [Thu, 17 Dec 2009 00:27:09 +0000 (01:27 +0100)]
Fix: race conditions in RESOURCE_ENTER/STATE/LEAVE (API Change!)
* RESOURCE_ENTER/STATE/LEAVE become Statement heads now and protect the
user supplied statement with the resource_mutex. This makes resource
transitions atomic.
* moved all locking into the macros
* refined example code