ccan
10 years agoccanlint: don't run valgrind tests in test dir.
Rusty Russell [Fri, 10 Sep 2010 03:05:37 +0000 (12:35 +0930)]
ccanlint: don't run valgrind tests in test dir.

We changed other tests to run in our tmpdir, missed this one.

10 years agoccanlint: print out compile targets for -vv.
Rusty Russell [Thu, 9 Sep 2010 14:08:36 +0000 (23:38 +0930)]
ccanlint: print out compile targets for -vv.

10 years agoccanlint: allow _info file to specify tests not to bother with.
Rusty Russell [Thu, 9 Sep 2010 11:08:52 +0000 (20:38 +0930)]
ccanlint: allow _info file to specify tests not to bother with.

I also changed -x to be specified multiple times rather than using , separators.

10 years agotdb: new command openjh for tdbtool (to use Jenkins hash)
Rusty Russell [Thu, 9 Sep 2010 11:08:13 +0000 (20:38 +0930)]
tdb: new command openjh for tdbtool (to use Jenkins hash)

10 years agotdb2: don't hold access to tdb mmap during traverse.
Rusty Russell [Thu, 9 Sep 2010 10:40:39 +0000 (20:10 +0930)]
tdb2: don't hold access to tdb mmap during traverse.

10 years agotdb2: change to using a hash tree.
Rusty Russell [Thu, 9 Sep 2010 09:29:18 +0000 (18:59 +0930)]
tdb2: change to using a hash tree.

As the locking issues with enlarging a hash were so nasty, we switch to a
tree structure for the entries.  It's a hash which expands to point to
sub-hashes when it fills.

This means we no longer have a 'volatile' header: the top hash cannot move.
In fact, we no longer store a copy of the header in the tdb_context; we only
need hash_seed.

New helper functions for accessing writable areas and committing the results
(if they had to be copied).  New debug test to make sure we don't hold access
while we're doing something which could cause us to unmap/remap.

Find becomes more complicated: we need to track where we found (or didn't
find) an entry so we can easily add/delete it.

Traverse becomes more complicated: we need to track where we were in the
hash tree.

10 years agotdb2: update documentation.
Rusty Russell [Thu, 9 Sep 2010 07:25:43 +0000 (16:55 +0930)]
tdb2: update documentation.

10 years agoMakefile: separate out junkpages target.
Rusty Russell [Fri, 3 Sep 2010 13:03:40 +0000 (22:33 +0930)]
Makefile: separate out junkpages target.

10 years agotdb2: make valgrind happier.
Rusty Russell [Fri, 3 Sep 2010 12:58:43 +0000 (22:28 +0930)]
tdb2: make valgrind happier.

10 years agotdb2: expand lock now nests inside other locks.
Rusty Russell [Fri, 3 Sep 2010 12:52:08 +0000 (22:22 +0930)]
tdb2: expand lock now nests inside other locks.

This eliminates all the "drop lock and retry" logic: we expand inside alloc().

10 years agotdb2: use immobile free buckets, rename tests to show some ordering.
Rusty Russell [Fri, 3 Sep 2010 12:39:40 +0000 (22:09 +0930)]
tdb2: use immobile free buckets, rename tests to show some ordering.

We put the free lists at the beginning of a zone; this means no record
can be larger than a zone, but means they cannot move.  Once we change
hashes to be expanding, they won't move either and the result should be
simpler.

10 years agotdb2: document problems with moving or enlarging hash table.
Rusty Russell [Fri, 3 Sep 2010 12:39:14 +0000 (22:09 +0930)]
tdb2: document problems with moving or enlarging hash table.

10 years agotdb2: traversal test.
Rusty Russell [Fri, 3 Sep 2010 12:37:40 +0000 (22:07 +0930)]
tdb2: traversal test.

10 years agojunkcode: new addition.
Rusty Russell [Thu, 2 Sep 2010 10:11:40 +0000 (19:41 +0930)]
junkcode: new addition.

10 years agotdb2: fix valgrind warnings.
Rusty Russell [Mon, 30 Aug 2010 13:14:54 +0000 (22:44 +0930)]
tdb2: fix valgrind warnings.

The unreserved headers were a real bug; the others could cause a false error too.

10 years agoccanlint: fix valgrind test.
Rusty Russell [Mon, 30 Aug 2010 13:10:04 +0000 (22:40 +0930)]
ccanlint: fix valgrind test.

We were not actually recording valgrind failures in ccanlint!

10 years agoccanlint: fix compiler warning about return value of symlink.
Rusty Russell [Mon, 30 Aug 2010 13:09:51 +0000 (22:39 +0930)]
ccanlint: fix compiler warning about return value of symlink.

10 years agotools: only print out creating directory the first time.
Rusty Russell [Mon, 30 Aug 2010 13:09:04 +0000 (22:39 +0930)]
tools: only print out creating directory the first time.

10 years agotdb2: traverse and chainlock support.
Rusty Russell [Mon, 30 Aug 2010 12:55:15 +0000 (22:25 +0930)]
tdb2: traverse and chainlock support.

These tests revealed more bugs with delete (rewritten) and hash enlargement.

10 years agotdb2: tdb_append implemented, beef up tests.
Rusty Russell [Mon, 30 Aug 2010 09:39:06 +0000 (19:09 +0930)]
tdb2: tdb_append implemented, beef up tests.

10 years agotdb2: more common code
Rusty Russell [Mon, 30 Aug 2010 06:54:48 +0000 (16:24 +0930)]
tdb2: more common code
Use hash_add() when resizing hash, too.

10 years agotdb2: fix argument order for tdb_gradual_lock.
Rusty Russell [Mon, 30 Aug 2010 06:51:23 +0000 (16:21 +0930)]
tdb2: fix argument order for tdb_gradual_lock.
This explains why most of tdb_gradual_lock was not tested: thanks gcov!

10 years agotdb2: extract common hashing code.
Rusty Russell [Mon, 30 Aug 2010 06:33:52 +0000 (16:03 +0930)]
tdb2: extract common hashing code.

10 years agotdb2: fixes and test for hash enlargement.
Rusty Russell [Mon, 30 Aug 2010 05:29:34 +0000 (14:59 +0930)]
tdb2: fixes and test for hash enlargement.

10 years agotdb2: more tests, hash collision fixes, attribute support.
Rusty Russell [Mon, 30 Aug 2010 04:59:08 +0000 (14:29 +0930)]
tdb2: more tests, hash collision fixes, attribute support.

10 years agoccanlint: fix abort on "-d ..".
Rusty Russell [Mon, 30 Aug 2010 03:14:15 +0000 (12:44 +0930)]
ccanlint: fix abort on "-d ..".

10 years agotests: now we run in tmp dir, always create temporary files in this dir.
Rusty Russell [Mon, 30 Aug 2010 03:06:23 +0000 (12:36 +0930)]
tests: now we run in tmp dir, always create temporary files in this dir.

10 years agoccanlint: use up to three -v to mean more verbosity.
Rusty Russell [Mon, 30 Aug 2010 01:21:48 +0000 (10:51 +0930)]
ccanlint: use up to three -v to mean more verbosity.
eg. -v dumps percentage of coverage, -vv dumps per-line data, -vvv dumps every command executed.

10 years agotools: add build_verbose to show every command executed.
Rusty Russell [Mon, 30 Aug 2010 01:21:33 +0000 (10:51 +0930)]
tools: add build_verbose to show every command executed.

10 years agotdb: fix lock-tracking test code after gradual lock changes.
Rusty Russell [Mon, 30 Aug 2010 01:11:57 +0000 (10:41 +0930)]
tdb: fix lock-tracking test code after gradual lock changes.

10 years agotdb2: new tests, and new fixes.
Rusty Russell [Sat, 28 Aug 2010 11:06:22 +0000 (20:36 +0930)]
tdb2: new tests, and new fixes.

10 years agotdb2: check that records are of sufficient length in tdb_check.
Rusty Russell [Sat, 28 Aug 2010 11:05:39 +0000 (20:35 +0930)]
tdb2: check that records are of sufficient length in tdb_check.

10 years agotdb2: split expand into functions and test separately.
Rusty Russell [Fri, 27 Aug 2010 05:33:41 +0000 (15:03 +0930)]
tdb2: split expand into functions and test separately.

10 years agoUpdate main page.
Rusty Russell [Fri, 27 Aug 2010 05:01:11 +0000 (14:31 +0930)]
Update main page.

10 years agoccanlint: chdir to temporary dir so gcov files land there.
Rusty Russell [Fri, 27 Aug 2010 04:27:23 +0000 (13:57 +0930)]
ccanlint: chdir to temporary dir so gcov files land there.

This means parallel "make check" works again.

10 years agoccanlint: use gcov to rate test coverage (score out of 5)
Rusty Russell [Fri, 27 Aug 2010 04:15:16 +0000 (13:45 +0930)]
ccanlint: use gcov to rate test coverage (score out of 5)

10 years agoccanlint: clean up code which outputs results, handle partial failure.
Rusty Russell [Fri, 27 Aug 2010 04:14:49 +0000 (13:44 +0930)]
ccanlint: clean up code which outputs results, handle partial failure.

10 years agotap: don't _exit on success
Rusty Russell [Fri, 27 Aug 2010 04:08:58 +0000 (13:38 +0930)]
tap: don't _exit on success

This prevents us from writing out gcov files.

10 years agotdb2: more fixes and tests for enlarging hash.
Rusty Russell [Thu, 26 Aug 2010 14:38:34 +0000 (00:08 +0930)]
tdb2: more fixes and tests for enlarging hash.
- Neaten I/O function
- Don't use fill in zero_out: it's only for low-level ops.
- Don't mangle arg in tdb_write_convert: it broke write_header.
- More use of tdb_access_read, make it optionally converting.
- Rename unlock_range to unlock_lists.
- Lots of fixes to enlarge_hash now it's being tested.
- More expansion cases tested.

10 years agotdb2: delete and fetch now work.
Rusty Russell [Thu, 26 Aug 2010 12:27:32 +0000 (21:57 +0930)]
tdb2: delete and fetch now work.

10 years agotdb2: clean up locking a little bit, fix hash wrap problem.
Rusty Russell [Thu, 26 Aug 2010 12:18:28 +0000 (21:48 +0930)]
tdb2: clean up locking a little bit, fix hash wrap problem.

10 years agotdb2: now we can store a key!
Rusty Russell [Thu, 26 Aug 2010 10:27:56 +0000 (19:57 +0930)]
tdb2: now we can store a key!

10 years agotdb2: tdb_expand on empty database now tested.
Rusty Russell [Thu, 26 Aug 2010 07:36:47 +0000 (17:06 +0930)]
tdb2: tdb_expand on empty database now tested.

10 years agotdb2: now checking a new empty database works.
Rusty Russell [Thu, 26 Aug 2010 05:07:18 +0000 (14:37 +0930)]
tdb2: now checking a new empty database works.

10 years agohash: 64-bit hash functions should take 64-bit base.
Rusty Russell [Thu, 26 Aug 2010 04:29:20 +0000 (13:59 +0930)]
hash: 64-bit hash functions should take 64-bit base.

10 years agotdb2: update config.h with more defines.
Rusty Russell [Thu, 26 Aug 2010 03:23:55 +0000 (12:53 +0930)]
tdb2: update config.h with more defines.

10 years agotdb2: initial commit (doesn't work, still writing tests)
Rusty Russell [Thu, 26 Aug 2010 03:22:59 +0000 (12:52 +0930)]
tdb2: initial commit (doesn't work, still writing tests)

10 years agoMakefile: don't hide what we're doing, user can use -s.
Rusty Russell [Mon, 16 Aug 2010 06:19:09 +0000 (15:49 +0930)]
Makefile: don't hide what we're doing, user can use -s.

10 years agohash: 64 bit variants.
Rusty Russell [Mon, 16 Aug 2010 06:07:19 +0000 (15:37 +0930)]
hash: 64 bit variants.

10 years agotdb: use tdb_lockall_gradual by default.
Rusty Russell [Fri, 13 Aug 2010 05:37:16 +0000 (15:07 +0930)]
tdb: use tdb_lockall_gradual by default.

This has the advantage the transactions will also use it, preventing them
from blocking.

10 years agotdb: test and resolultion for tdb_lockall starvation.
Rusty Russell [Fri, 13 Aug 2010 05:19:59 +0000 (14:49 +0930)]
tdb: test and resolultion for tdb_lockall starvation.

10 years agoweb: handle symlinks in bzrbrowse.cgi, fix images.
Rusty Russell [Sat, 7 Aug 2010 03:11:24 +0000 (12:41 +0930)]
web: handle symlinks in bzrbrowse.cgi, fix images.

10 years agoweb: make sure to include symlinks in tarballs
Rusty Russell [Fri, 6 Aug 2010 13:34:27 +0000 (23:04 +0930)]
web: make sure to include symlinks in tarballs

10 years agoAdd author and maintainer fields.
Rusty Russell [Fri, 6 Aug 2010 13:08:02 +0000 (22:38 +0930)]
Add author and maintainer fields.

10 years agoAdd licences/ dir and symlinks for a bit more clarity.
Rusty Russell [Fri, 6 Aug 2010 13:01:23 +0000 (22:31 +0930)]
Add licences/ dir and symlinks for a bit more clarity.

10 years agoalloc: speed up tiny allocator
Rusty Russell [Thu, 29 Jul 2010 00:49:01 +0000 (10:19 +0930)]
alloc: speed up tiny allocator

10 years agoalloc: remove unused debugging function.
Rusty Russell [Wed, 28 Jul 2010 13:44:28 +0000 (23:14 +0930)]
alloc: remove unused debugging function.

10 years agoalloc: reduce number of large pages to 256.
Rusty Russell [Wed, 28 Jul 2010 13:40:58 +0000 (23:10 +0930)]
alloc: reduce number of large pages to 256.

This reduces the number of huge allocs, which drops test time from 6 minutes to 57 seconds.

10 years agoalloc: implement huge allocations
Rusty Russell [Wed, 28 Jul 2010 13:05:08 +0000 (22:35 +0930)]
alloc: implement huge allocations

Inefficient scheme for allocations > 1/8192 of the pool size.

10 years agoalloc: fix bug in tiny allocator.
Rusty Russell [Tue, 27 Jul 2010 05:32:02 +0000 (15:02 +0930)]
alloc: fix bug in tiny allocator.

10 years agoalloc: fix typo which can cause false assertion
Rusty Russell [Tue, 20 Jul 2010 22:51:08 +0000 (08:21 +0930)]
alloc: fix typo which can cause false assertion

10 years agoalloc: fix bug in tiny allocator
Rusty Russell [Thu, 15 Jul 2010 08:40:47 +0000 (18:10 +0930)]
alloc: fix bug in tiny allocator

We can have a 0 byte in the *middle* of an encoding.

10 years agoalloc: remove encode limit arg, and implement free array cache.
Rusty Russell [Mon, 12 Jul 2010 23:42:49 +0000 (09:12 +0930)]
alloc: remove encode limit arg, and implement free array cache.

10 years agoalloc: first cut of tiny allocator (down to 2 bytes!)
Rusty Russell [Mon, 12 Jul 2010 13:52:30 +0000 (23:22 +0930)]
alloc: first cut of tiny allocator (down to 2 bytes!)

10 years agotypesafe_cb: fix fallout from API changes.
Rusty Russell [Tue, 15 Jun 2010 10:10:44 +0000 (19:40 +0930)]
typesafe_cb: fix fallout from API changes.

10 years agotypesafe_cb: expose _exact and _def variants.
Rusty Russell [Tue, 15 Jun 2010 10:02:55 +0000 (19:32 +0930)]
typesafe_cb: expose _exact and _def variants.

We can't allow NULL with the new variant (needed by talloc's set_destructor
for example), so document that and expose all three variants for different
uses.

10 years agotypesafe_cb: fix promotable types being incorrectly accepted by cast_if_type.
Rusty Russell [Fri, 11 Jun 2010 03:36:40 +0000 (13:06 +0930)]
typesafe_cb: fix promotable types being incorrectly accepted by cast_if_type.

cast_if_type() should not try to degrade the expression using 1?(test):0,
as that promotes bool to int, as well as degrading functions to function
pointers: it should be done by the callers.

In particular, this fixes sparse_bsearch.

10 years agoalloc: reduce page header further, go down to 64k minimum.
Rusty Russell [Wed, 9 Jun 2010 14:33:04 +0000 (00:03 +0930)]
alloc: reduce page header further, go down to 64k minimum.

This means we can't have more than 2^25 elements per page; that's
a maximum small page size of about 2^24 (with >8 objects per small page
we move to large pages), meaning a poolsize max of 4G.

We have a tighter limit at the moment anyway, but we should remove it
once we fix this.  In particular count all-zero and all-one words in
the used field (that's what we care about: full or empty) would give us
another factor of 64 (we only care about larger pool sizes on 64-bit
platforms).

We can also restore the larger number of pages and greater inter-page
spacing once we implement the alternative tiny allocator.

10 years agoalloc: make small_page_bits() function rather than large_page_bits()
Rusty Russell [Wed, 9 Jun 2010 14:22:54 +0000 (23:52 +0930)]
alloc: make small_page_bits() function rather than large_page_bits()

Turns out that now we use page numbers, this is more fundamental.

10 years agoalloc: use page numbers in lists to reduce overhead.
Rusty Russell [Wed, 9 Jun 2010 14:16:03 +0000 (23:46 +0930)]
alloc: use page numbers in lists to reduce overhead.

10 years agoalloc: implement alloc_visualize().
Rusty Russell [Wed, 9 Jun 2010 13:05:21 +0000 (22:35 +0930)]
alloc: implement alloc_visualize().

10 years agoalloc: fix page header size calculation bug, increase type safety.
Rusty Russell [Wed, 9 Jun 2010 13:04:44 +0000 (22:34 +0930)]
alloc: fix page header size calculation bug, increase type safety.

10 years agoidtree: add examples, particularly the low-id-reuse example.
Rusty Russell [Wed, 9 Jun 2010 06:44:48 +0000 (16:14 +0930)]
idtree: add examples, particularly the low-id-reuse example.

10 years agoalloc: first cut of new Tridge-inspired allocator
Rusty Russell [Tue, 8 Jun 2010 03:57:06 +0000 (13:27 +0930)]
alloc: first cut of new Tridge-inspired allocator

This version has limitations: pools must be at least 1MB, and allocations
are restricted to 1/1024 of the total pool size.

10 years agoccanlint: don't setpgid on running commands: we want ^C to work!
Rusty Russell [Mon, 7 Jun 2010 07:57:15 +0000 (17:27 +0930)]
ccanlint: don't setpgid on running commands: we want ^C to work!

10 years agoccanlint: Add -k option to keep results.
Rusty Russell [Mon, 7 Jun 2010 07:15:49 +0000 (16:45 +0930)]
ccanlint: Add -k option to keep results.

Particularly useful for building tests standalone.

10 years agoccanlint: make sure fullname is always full path name.
Rusty Russell [Mon, 7 Jun 2010 07:04:15 +0000 (16:34 +0930)]
ccanlint: make sure fullname is always full path name.

10 years agohashtable: fix traverse typesafety.
Rusty Russell [Mon, 7 Jun 2010 04:30:22 +0000 (14:00 +0930)]
hashtable: fix traverse typesafety.

10 years agotypesafe_cb: fix up (and test!) cast_if_any.
Rusty Russell [Mon, 7 Jun 2010 04:29:18 +0000 (13:59 +0930)]
typesafe_cb: fix up (and test!) cast_if_any.

10 years agotypesafe_cb: handle pointers to undefined struct types.
Rusty Russell [Mon, 24 May 2010 03:02:59 +0000 (12:32 +0930)]
typesafe_cb: handle pointers to undefined struct types.

To do this, we have to lose the ability for preargs and postargs to allow const and volatile argument signatures.

10 years agotypesafe_cb: show flaw in typesafe_cb with undefined structs.
Rusty Russell [Mon, 24 May 2010 01:17:13 +0000 (10:47 +0930)]
typesafe_cb: show flaw in typesafe_cb with undefined structs.

10 years agotypesafe_cb: fix !gcc case
Rusty Russell [Sun, 23 May 2010 11:02:53 +0000 (20:32 +0930)]
typesafe_cb: fix !gcc case

10 years agotypesafe_cb, hashtable: revise typesafe_cb arg order, neaten.
Rusty Russell [Sun, 23 May 2010 09:22:18 +0000 (18:52 +0930)]
typesafe_cb, hashtable: revise typesafe_cb arg order, neaten.
hashtable: make traverse callback typesafe.

10 years agoidtree: new module
Rusty Russell [Thu, 20 May 2010 12:30:32 +0000 (22:00 +0930)]
idtree: new module

10 years agolikely: new module
Rusty Russell [Tue, 11 May 2010 02:34:35 +0000 (12:04 +0930)]
likely: new module

10 years agoccanlint: put generated _info in correct directory.
Rusty Russell [Tue, 11 May 2010 02:01:08 +0000 (11:31 +0930)]
ccanlint: put generated _info in correct directory.

10 years agostr: add stringify()
Rusty Russell [Tue, 11 May 2010 00:53:40 +0000 (10:23 +0930)]
str: add stringify()

11 years agoMore web fixes.
Rusty Russell [Tue, 4 May 2010 07:37:32 +0000 (17:07 +0930)]
More web fixes.

11 years agotdb: fix backwards check on HAVE_PAGESIZE
Rusty Russell [Tue, 4 May 2010 07:36:40 +0000 (17:06 +0930)]
tdb: fix backwards check on HAVE_PAGESIZE

11 years agoHashtable routines.
Rusty Russell [Tue, 4 May 2010 02:21:10 +0000 (11:51 +0930)]
Hashtable routines.

11 years agotools: fastcheck adjust; 750ms works well for me.
Rusty Russell [Fri, 9 Apr 2010 06:24:02 +0000 (15:54 +0930)]
tools: fastcheck adjust; 750ms works well for me.

11 years agoccanlint: optimize the timeout case
Rusty Russell [Fri, 9 Apr 2010 04:42:53 +0000 (14:12 +0930)]
ccanlint: optimize the timeout case

This takes my "make fastcheck" from about 57 seconds to about 43 seconds.

11 years agoFix EXCLUDE logic for makefiles, add fastcheck
Rusty Russell [Fri, 9 Apr 2010 04:30:02 +0000 (14:00 +0930)]
Fix EXCLUDE logic for makefiles, add fastcheck

11 years agoccanlint: always catch timeouts, and force kill valgrind etc.
Rusty Russell [Fri, 9 Apr 2010 04:29:22 +0000 (13:59 +0930)]
ccanlint: always catch timeouts, and force kill valgrind etc.

11 years agoccanlint: timeout, and implement -t option for quicker tests.
Rusty Russell [Fri, 9 Apr 2010 03:51:26 +0000 (13:21 +0930)]
ccanlint: timeout, and implement -t option for quicker tests.

11 years agoUse bzr to determine what to upload
Rusty Russell [Fri, 9 Apr 2010 03:51:11 +0000 (13:21 +0930)]
Use bzr to determine what to upload

11 years agoccanlint: clean up test short descriptions
Rusty Russell [Fri, 9 Apr 2010 02:21:42 +0000 (11:51 +0930)]
ccanlint: clean up test short descriptions

11 years agoccanlint: cleanup listing code, make print in topo order.
Rusty Russell [Fri, 9 Apr 2010 02:12:10 +0000 (11:42 +0930)]
ccanlint: cleanup listing code, make print in topo order.

11 years agoFrom: Joseph Adams <joeyadams3.14159@gmail.com>
Rusty Russell [Fri, 9 Apr 2010 01:28:21 +0000 (10:58 +0930)]
From: Joseph Adams <joeyadams3.14159@gmail.com>

The ccanlint patch is rather intrusive.  First, it adds a new field to
all the ccanlint tests, "key".  key is a shorter, still unique
description of the test (e.g. "valgrind").  The names I chose as keys
for all the tests are somewhat arbitrary and often don't reflect the
name of the .c source file (because some of those names are just too
darn long).  Second, it adds two new options to ccanlint:

   -l: list tests ccanlint performs
   -x: exclude tests (e.g. -x trailing_whitespace,valgrind)

It also adds a consistency check making sure all tests have unique
keys and names.

The primary goal of the ccanlint patch was so I could exclude the
valgrind test, which takes a really long time for some modules (I
think btree takes the longest, at around 2 minutes).  I'm not sure I
did it 100% correctly, so you'll want to review it first.

11 years agoFrom: Joseph Adams <joeyadams3.14159@gmail.com>
Rusty Russell [Fri, 9 Apr 2010 01:24:31 +0000 (10:54 +0930)]
From: Joseph Adams <joeyadams3.14159@gmail.com>

The btree patch gives the btree module an intuitive frontend
(btree_insert, btree_remove, btree_lookup) and a built-in ordering
function for strings.  Together, these make it easy to use the btree
module as a dynamic string map.