profile/ivi/murphy.git
9 years agolibresource: fix errors found by static analysis.
Ismo Puustinen [Fri, 19 Sep 2014 07:50:23 +0000 (10:50 +0300)]
libresource: fix errors found by static analysis.

9 years agoprocess: fix an error found by static analysis.
Ismo Puustinen [Fri, 19 Sep 2014 07:32:18 +0000 (10:32 +0300)]
process: fix an error found by static analysis.

9 years agodocs: generally document compilation in README.md. v0.0.56
Jan Ekström [Wed, 10 Sep 2014 10:41:39 +0000 (13:41 +0300)]
docs: generally document compilation in README.md.

9 years agobuild: change Automake strictness to "foreign".
Jan Ekström [Wed, 10 Sep 2014 08:32:52 +0000 (11:32 +0300)]
build: change Automake strictness to "foreign".

This removes automake's need to copy standard GNU INSTALL file
when run with --install. Additionally removes INSTALL as we
do not use it in Murphy

9 years agobuild-sys: Add checks for Debian-packaged lua.
Jan Ekström [Thu, 4 Sep 2014 13:37:03 +0000 (16:37 +0300)]
build-sys: Add checks for Debian-packaged lua.

This adds checks for lua5.2 and lua5.1, and keeps the override
available for cases where a specific lua version is needed.

9 years agolua-utils: correct a type check for a Lua array collection. v0.0.55
Jan Ekström [Thu, 4 Sep 2014 10:53:13 +0000 (13:53 +0300)]
lua-utils: correct a type check for a Lua array collection.

Also put there a clarifying comment about the check.

9 years agodomain-control: think harder, Homer ! (more column check fixes).
Krisztian Litkey [Wed, 3 Sep 2014 13:14:40 +0000 (16:14 +0300)]
domain-control: think harder, Homer ! (more column check fixes).

9 years agobuild-sys: check and bail out for explicitly detected missing yacc/bison.
Krisztian Litkey [Wed, 3 Sep 2014 08:09:25 +0000 (11:09 +0300)]
build-sys: check and bail out for explicitly detected missing yacc/bison.

9 years agobuild-sys: check and bail out for explicitly detected missing [f]lex.
Krisztian Litkey [Wed, 3 Sep 2014 08:00:43 +0000 (11:00 +0300)]
build-sys: check and bail out for explicitly detected missing [f]lex.

9 years agodomain-control: fix check for exceeding total column count.
Krisztian Litkey [Tue, 2 Sep 2014 08:10:38 +0000 (11:10 +0300)]
domain-control: fix check for exceeding total column count.

9 years agobuild: Don't install license or the INSTALL file
Jan Ekström [Thu, 28 Aug 2014 09:43:07 +0000 (12:43 +0300)]
build: Don't install license or the INSTALL file

Per-distribution packaging usually handles the license, and
INSTALL usually isn't installed to the system at all.

9 years agobuild-sys: pass $(CC) as the preprocessor to collect-symbols. v0.0.54
Krisztian Litkey [Mon, 25 Aug 2014 14:30:44 +0000 (17:30 +0300)]
build-sys: pass $(CC) as the preprocessor to collect-symbols.

9 years agocollect-symbols: unshave preprocessor if given.
Krisztian Litkey [Mon, 25 Aug 2014 14:21:37 +0000 (17:21 +0300)]
collect-symbols: unshave preprocessor if given.

9 years agoresource-native: get rid of creeping unuseitis.
Krisztian Litkey [Thu, 21 Aug 2014 14:33:15 +0000 (17:33 +0300)]
resource-native: get rid of creeping unuseitis.

9 years agobuild-sys: check for malloc only if we're not cross-compiling.
Krisztian Litkey [Thu, 21 Aug 2014 14:22:57 +0000 (17:22 +0300)]
build-sys: check for malloc only if we're not cross-compiling.

9 years agobuild-sys: removed old cruft, safer flex/bison checks.
Krisztian Litkey [Thu, 21 Aug 2014 14:04:27 +0000 (17:04 +0300)]
build-sys: removed old cruft, safer flex/bison checks.

9 years agobuild-sys: try to get collect-symbols right when cross-compiling.
Krisztian Litkey [Thu, 21 Aug 2014 12:37:03 +0000 (15:37 +0300)]
build-sys: try to get collect-symbols right when cross-compiling.

9 years agocommon: Don't use the trailing null with unix socket paths
Jan Ekström [Thu, 7 Aug 2014 10:43:45 +0000 (13:43 +0300)]
common: Don't use the trailing null with unix socket paths

Affects {stream,dgram}-transport; Bind/connect doesn't ignore/
remove the null, and most things don't have a null at the end
of the socket's path.

9 years agobuild: Add JSON_LIBS to murphyd's linker flags
Jan Ekström [Mon, 28 Jul 2014 12:42:37 +0000 (15:42 +0300)]
build: Add JSON_LIBS to murphyd's linker flags

9 years agowebsockets: Do not output creation events with a seq of 0
Jan Ekström [Thu, 31 Jul 2014 11:07:33 +0000 (14:07 +0300)]
websockets: Do not output creation events with a seq of 0

This was the only event as a response that didn't match the seq
with the query's

9 years agowebsockets/json: Fix crashes due to misuse of internal APIs
Jan Ekström [Tue, 29 Jul 2014 10:06:41 +0000 (13:06 +0300)]
websockets/json: Fix crashes due to misuse of internal APIs

This enables usage of the test page without causing segfaults

9 years agolibresource: Catch an allocation failure
Jan Ekström [Tue, 22 Jul 2014 11:13:10 +0000 (14:13 +0300)]
libresource: Catch an allocation failure

9 years agodomain-control: Improve set/notify parsing
Jan Ekström [Tue, 22 Jul 2014 11:12:20 +0000 (14:12 +0300)]
domain-control: Improve set/notify parsing

This fixes warnings given out by clang's static analyzer

9 years agoresource-backend: emit resource set events and extend the client API.
Ismo Puustinen [Mon, 5 May 2014 10:38:24 +0000 (13:38 +0300)]
resource-backend: emit resource set events and extend the client API.

9 years agocore: funcbridge can now return arrays.
Ismo Puustinen [Tue, 3 Jun 2014 14:09:40 +0000 (17:09 +0300)]
core: funcbridge can now return arrays.

The values of arrays are limited to { number, boolean, string }. The numbers are
returned as doubles.

9 years agotest-domain-controller, plugin-test: add a test for proxied domain functions.
Krisztian Litkey [Fri, 2 May 2014 10:49:59 +0000 (13:49 +0300)]
test-domain-controller, plugin-test: add a test for proxied domain functions.

9 years agocore, domain-control: added proxied domain function calls.
Krisztian Litkey [Fri, 2 May 2014 10:48:53 +0000 (13:48 +0300)]
core, domain-control: added proxied domain function calls.

Added a mechanism for exporting and invoking 'domain' functions.
Domain controllers can register functions which then can be invoked
by the core. The core uses the domain-control plugin to proxy the
call to and the return from the invocation. These functions currently
cannot be queried by the core. Trying to invoke a non-existing function
will fail asynchronously. Trying to invoke a function of a non-existing
domain controller will fail synchronously.

Similarly, the core can export functions which then can be invoked
by domain controllers. The domain-control plugin proxies the call to
and the return from the invocation. These functions currently cannot
be queried by the domain-controllers. Trying to invoke a non-existing
function will fail asynchronously.

We shouldn't need to have a domain-control specific export mechanism
at all. We need to replace all the various import/export/invocation
mechanism (there is one at least in the plugin infra, in the resolver
and now this) with a single one at its core and only adapt it as
necessary for these various components. Eventually...

9 years agocommon/tests: added hash12-test.c that fell off in the previous hand-merge.
Jan Ekström [Tue, 19 Aug 2014 12:01:30 +0000 (15:01 +0300)]
common/tests: added hash12-test.c that fell off in the previous hand-merge.

9 years agocommon: mainloop support for edge-triggered I/O events.
Krisztian Litkey [Wed, 25 Jun 2014 09:39:18 +0000 (12:39 +0300)]
common: mainloop support for edge-triggered I/O events.

This patch adds support for specifying on a per-watch basis whether
I/O events should be level or edge-triggered and also for setting
and retrieving the default I/O event trigger mode.

Because we provide both default and per-watch settings, we need an
extra flag for indicating level-triggered mode for a watch when the
default is set to EPOLLET (MRP_IO_TRIGGER_EDGE). This makes the patch
slightly more complex than just providing the necessary enum flags.

9 years agobuild-sys: silence/fix warnings from autotools.
Krisztian Litkey [Fri, 15 Aug 2014 06:55:25 +0000 (09:55 +0300)]
build-sys: silence/fix warnings from autotools.

9 years agocommon/tests: add a hash table test that adds and removes twelve objects.
Jan Ekström [Mon, 4 Aug 2014 12:43:04 +0000 (15:43 +0300)]
common/tests: add a hash table test that adds and removes twelve objects.

9 years agocommon/hashtbl: always unlink empty buckets from the used list.
Jan Ekström [Mon, 4 Aug 2014 12:23:30 +0000 (15:23 +0300)]
common/hashtbl: always unlink empty buckets from the used list.

9 years agocommon: quit iterating for MRP_HTBL_ITER_STOP verdict.
Krisztian Litkey [Mon, 4 Aug 2014 09:28:41 +0000 (12:28 +0300)]
common: quit iterating for MRP_HTBL_ITER_STOP verdict.

9 years agoresource-dbus: Merge requesting and release of sets
Jan Ekström [Mon, 21 Jul 2014 14:05:06 +0000 (17:05 +0300)]
resource-dbus: Merge requesting and release of sets

Less duplicate code, fixes creation->release flow by enabling
further acquisitions. Also set initialization moved to its own
function.

10 years agolibresource: Improve the documentation for release of sets
Jan Ekström [Wed, 16 Jul 2014 07:00:39 +0000 (10:00 +0300)]
libresource: Improve the documentation for release of sets

Document the fact that release can be used for start of delivery
of Resource callbacks for sets in cases where actually acquiring
the set is not wished for.

10 years agolibresource: Info instead of error when ignoring events
Jan Ekström [Tue, 15 Jul 2014 12:18:00 +0000 (15:18 +0300)]
libresource: Info instead of error when ignoring events

The printed message is used for both informational purposes
as well as when there is an error state - and with error
states there are always other error messages printed, so
having this message be printed out by default is not
necessary. Modifies the printed message, as ignoring events
is not specific to cases of malformed data.

As a side effect, this stops "ignoring malformed resource
event" error messages from coming up in the log when
receiving the first message from Murphy (could be replicated
with both resource-api-test as well as my Python wrapper).

10 years agomdb: Propagate a value gotten from realloc()
Jan Ekström [Tue, 8 Jul 2014 11:11:18 +0000 (14:11 +0300)]
mdb: Propagate a value gotten from realloc()

Neither ISO C, POSIX or GNU libc seem to guarantee that the pointer
stays the same with size being smaller than the current size. Thus
we need to propagate the pointer, even if it in many cases ends up
being the same one.

10 years agomql: Use correct pointer type
Jan Ekström [Tue, 8 Jul 2014 07:23:14 +0000 (10:23 +0300)]
mql: Use correct pointer type

10 years agobuild: Fix a copy-paste dependency error in libbreedline-glib
Jan Ekström [Mon, 7 Jul 2014 13:25:20 +0000 (16:25 +0300)]
build: Fix a copy-paste dependency error in libbreedline-glib

Fixes multi-process builds, before it was up to luck whether or
not you had the dependencies already built or not.

10 years agowebsockets: add support for the latest API-breaking upstream changes.
Krisztian Litkey [Wed, 9 Jul 2014 11:44:19 +0000 (14:44 +0300)]
websockets: add support for the latest API-breaking upstream changes.

10 years agocommon: band-aid attempt for better xwalk event loop integration.
Krisztian Litkey [Tue, 24 Jun 2014 06:06:06 +0000 (09:06 +0300)]
common: band-aid attempt for better xwalk event loop integration.

This patch tries to open up the mainloop for better integration
with the threaded external event loops (mostly xwalk in particular).

10 years agolibresource: API cleanup, remove unnecessary function arguments.
Jan Ekström [Wed, 25 Jun 2014 08:24:40 +0000 (11:24 +0300)]
libresource: API cleanup, remove unnecessary function arguments.

10 years agolibresource: Add context to resource sets, set a set for listing resources
Jan Ekström [Wed, 25 Jun 2014 13:59:51 +0000 (16:59 +0300)]
libresource: Add context to resource sets, set a set for listing resources

This enables the removal of passing of contexts and resource sets
unneededly.

10 years agolibresource: Docs - Fix documentation on two functions
Jan Ekström [Wed, 25 Jun 2014 14:30:15 +0000 (17:30 +0300)]
libresource: Docs - Fix documentation on two functions

mrp_res_list_attribute_names and mrp_res_get_attribute_by_name
had the wrong return type as well as an extraneous parameter.

10 years agoMurphy: Add .gitignore
Jan Ekström [Tue, 13 May 2014 12:27:53 +0000 (15:27 +0300)]
Murphy: Add .gitignore

10 years agocommon: fix a few debug infra-related comments. v0.0.53
Krisztian Litkey [Wed, 4 Jun 2014 12:41:36 +0000 (15:41 +0300)]
common: fix a few debug infra-related comments.

10 years agobuild-sys: removed gen-debug-table.
Krisztian Litkey [Tue, 3 Jun 2014 19:42:15 +0000 (22:42 +0300)]
build-sys: removed gen-debug-table.

10 years agocommon: removed support for listing debug sites.
Krisztian Litkey [Tue, 3 Jun 2014 19:41:19 +0000 (22:41 +0300)]
common: removed support for listing debug sites.

10 years agoconsole: stop listing debug sites.
Krisztian Litkey [Tue, 3 Jun 2014 19:41:02 +0000 (22:41 +0300)]
console: stop listing debug sites.

10 years agoresolver: stop listing debug sites (in parser-test).
Krisztian Litkey [Tue, 3 Jun 2014 19:40:37 +0000 (22:40 +0300)]
resolver: stop listing debug sites (in parser-test).

10 years agodaemon: stop listing debug sites.
Krisztian Litkey [Tue, 3 Jun 2014 19:40:21 +0000 (22:40 +0300)]
daemon: stop listing debug sites.

10 years agobuild-sys: stop generating file:line->function mapping tables.
Krisztian Litkey [Tue, 3 Jun 2014 19:08:32 +0000 (22:08 +0300)]
build-sys: stop generating file:line->function mapping tables.

The original debug macros were written with older version of gcc in
mind where (in retrospect admittably strangely enough) __FUNCTION__
used to be a full-fledged preprocessor macro that could be among
other things freely concatenated with other string tokens to produce
string literals. The big idea was that each invocation of one of the
debug macros would also produce a site-specific entry to the string
table with a common distinctive/unique enough prefix (__DEBUG_SITE).
This then would make it (relatively) easy to list all existing debug
sites by looping through all the string tables of all mapped shared
objects (using dl_iterate_phdr) and inferring each debug site from the
correspinding string table entry with a matching prefix.

Since fate is cruel, gcc stopped supporting its good ol' full-fledged
__FUNCTION__ ages ago and turned it to a mere alias to __func__ which
is just an automatic variable, which is pretty useless for anything but
printing. One can't compilte-time concatenate it or perform other useful
macro-operations on it at all. As a desperate (and arguably quite brain-
damaged) idea we changed the debug macro to be a mere prefixed file:line
string literal and started generating file:line->function mapping tables
that we used to run-time map the debug sites to function names. So much
effort just to be able to list all the debug sites...

To add insult to injury, this whole scheme falls apart horribly with our
latest additions to the debug macros which proxy/bridge debug calls from
other libraries (or sometimes languages), where the macro invocation
itself is not at the actual originating debug site at all.

So in retrospect it is better to get rid of the whole mechanism altogether
and either trust people to know the code well enough so they know which
debug sites to enable or let them first shoot with a cannon by enabling
all the debug sites before narrowing the scope by picking only the ones
they need once they have read through the flood or resulting debug log
and found out more precisely what they want/need...

10 years agocommon: parse log levels 'none' and 'off' to mask 0.
Krisztian Litkey [Tue, 27 May 2014 16:57:51 +0000 (19:57 +0300)]
common: parse log levels 'none' and 'off' to mask 0.

10 years agoMerge branch 'master' of github.com:otcshare/policy-internal submit/tizen/20140527.105448 submit/tizen_ivi/20140527.143109
Krisztian Litkey [Tue, 27 May 2014 10:08:08 +0000 (13:08 +0300)]
Merge branch 'master' of github.com:otcshare/policy-internal

10 years agobuild-sys: get rid of the unused generate-linker-script targets.
Krisztian Litkey [Tue, 27 May 2014 10:03:20 +0000 (13:03 +0300)]
build-sys: get rid of the unused generate-linker-script targets.

10 years agobuild-sys: try to get along without a C++ compiler if Qt is not enabled.
Krisztian Litkey [Tue, 27 May 2014 08:10:33 +0000 (11:10 +0300)]
build-sys: try to get along without a C++ compiler if Qt is not enabled.

10 years agobuild-sys: advertise all .la's from LIBADD's as dependencies. v0.0.52
Krisztian Litkey [Fri, 23 May 2014 17:39:29 +0000 (20:39 +0300)]
build-sys: advertise all .la's from LIBADD's as dependencies.

Properly advertise all libraries built by the same Makefile(.am)
and present in *_LIBADD's as dependencies to avoid build failures.

10 years agobuild-sys: fix a couple of linking mistakes and omissions.
Krisztian Litkey [Wed, 21 May 2014 15:37:02 +0000 (18:37 +0300)]
build-sys: fix a couple of linking mistakes and omissions.

There is one more subtle issue remaining, namely we currently have
an ugly circular/cross-dependency between lua-decision, core and
resolver. For the time being it won't be addressed as we can work
er... link around it anyway.

10 years agocommon: cope with latest json-c include path changes.
Krisztian Litkey [Wed, 21 May 2014 13:14:26 +0000 (16:14 +0300)]
common: cope with latest json-c include path changes.

10 years agoresource-dbus: store pending event data.
Ismo Puustinen [Tue, 20 May 2014 11:06:54 +0000 (14:06 +0300)]
resource-dbus: store pending event data.

Store event data that has come before acquisition so that we can
deliver all events to the client.

10 years agodomain-control: don't fail decoding a fully empty set message.
Krisztian Litkey [Fri, 9 May 2014 14:59:47 +0000 (17:59 +0300)]
domain-control: don't fail decoding a fully empty set message.

10 years agocommon: oops... careful with that axe, Eugene.
Krisztian Litkey [Tue, 6 May 2014 15:16:14 +0000 (18:16 +0300)]
common: oops... careful with that axe, Eugene.

Undo the potential damage done to our native timers (picking
ad infinitum instead of the correct next one), introduced by
the subloop-timer fix in commit d804f968, and triggerable when
running under a superloop.

10 years agoMerge remote-tracking branch 'private/master'
Krisztian Litkey [Fri, 2 May 2014 14:46:24 +0000 (17:46 +0300)]
Merge remote-tracking branch 'private/master'

10 years agocommon: added missing MRP_MSG_FIELD_ARRAY_TYPE macro.
Krisztian Litkey [Fri, 2 May 2014 14:33:22 +0000 (17:33 +0300)]
common: added missing MRP_MSG_FIELD_ARRAY_TYPE macro.

10 years agocommon: added a macro to run code depending on debug settings.
Krisztian Litkey [Fri, 2 May 2014 14:32:34 +0000 (17:32 +0300)]
common: added a macro to run code depending on debug settings.

10 years agocommon: added integer and unsigned msg field types (aliasen for int32 and uin32).
Krisztian Litkey [Fri, 2 May 2014 09:55:04 +0000 (12:55 +0300)]
common: added integer and unsigned msg field types (aliasen for int32 and uin32).

10 years agomainloop: don't miss subloop timers if we have no native ones.
Krisztian Litkey [Wed, 30 Apr 2014 09:31:37 +0000 (12:31 +0300)]
mainloop: don't miss subloop timers if we have no native ones.

10 years agomainloop: when running under a superloop adjust timer if necessary.
Krisztian Litkey [Fri, 25 Apr 2014 15:01:20 +0000 (18:01 +0300)]
mainloop: when running under a superloop adjust timer if necessary.

10 years agoresource-dbus: better error handling.
Ismo Puustinen [Fri, 2 May 2014 10:38:44 +0000 (13:38 +0300)]
resource-dbus: better error handling.

10 years agoresource-dbus: removed signatures when filling dict entries.
Ismo Puustinen [Fri, 2 May 2014 10:29:47 +0000 (13:29 +0300)]
resource-dbus: removed signatures when filling dict entries.

10 years agoresource-dbus: handle better the case when there is an unknown resource.
Ismo Puustinen [Wed, 30 Apr 2014 10:45:39 +0000 (13:45 +0300)]
resource-dbus: handle better the case when there is an unknown resource.

10 years agolibresource: do not print the resource sets after each operation.
Ismo Puustinen [Thu, 3 Apr 2014 10:34:58 +0000 (13:34 +0300)]
libresource: do not print the resource sets after each operation.

10 years agolibresource: cleaned up an error message.
Ismo Puustinen [Thu, 3 Apr 2014 10:29:42 +0000 (13:29 +0300)]
libresource: cleaned up an error message.

10 years agocommon: change MRP_DEBUG_SITE to compile with older g++.
Krisztian Litkey [Tue, 1 Apr 2014 13:32:56 +0000 (16:32 +0300)]
common: change MRP_DEBUG_SITE to compile with older g++.

10 years agolua-5.2: provide lua_objlen compatibility macro if necessary.
Krisztian Litkey [Mon, 31 Mar 2014 10:55:00 +0000 (13:55 +0300)]
lua-5.2: provide lua_objlen compatibility macro if necessary.

If Lua is compiled without LUA_COMPAT_ALL luaconf.h will not
provide a few macros for backward-compatibility, including
lua_objlen. Detect this and provide lua_objlen in lua-utils.h
if necessary.

10 years agocommon: don't include unused syslog.h in log.h.
Krisztian Litkey [Sat, 29 Mar 2014 12:01:40 +0000 (14:01 +0200)]
common: don't include unused syslog.h in log.h.

10 years agocommon: add missing CDECL-wrapper to debug-info.h.
Krisztian Litkey [Sat, 29 Mar 2014 11:59:57 +0000 (13:59 +0200)]
common: add missing CDECL-wrapper to debug-info.h.

10 years agocommon: fix an error path crash for mrp_msg_t. v0.0.51
Krisztian Litkey [Tue, 25 Mar 2014 22:53:40 +0000 (00:53 +0200)]
common: fix an error path crash for mrp_msg_t.

Initialize properly the hook for array fields too, in case creating the
field fails. On the bailout path we try to unlink the field...

10 years agolua-utils: add a workaround for occasional Lua stack overflow.
Krisztian Litkey [Fri, 21 Mar 2014 21:02:45 +0000 (23:02 +0200)]
lua-utils: add a workaround for occasional Lua stack overflow.

We have a systematic stack-handling bug throughout our codebase.
We never ever grow the Lua stack according to our needs. We rely
on the default available space to be enough. When we occasionally
do run out of stack space, this causes severe memory corruption.

This is quite easy to trigger with Lua 5.1.x but much harder with
Lua 5.2.x (I could not reproduce this with it at all).

This patch is merely a desperate attempt to try and hide the
damage caused by the bug. In a couple of commonly used functions
we make sure there's plenty of space in the stack and hope that
it will be enough also for those who do not take care of this
themselves.

Eventually we'll need to properly fix this throughout the code.

10 years agolua-bindings: autoenable debugging when 'lua debug' is enabled.
Krisztian Litkey [Fri, 21 Mar 2014 15:14:45 +0000 (17:14 +0200)]
lua-bindings: autoenable debugging when 'lua debug' is enabled.

10 years agoplugin-resource-native: adjust dump buffer if needed.
Krisztian Litkey [Fri, 21 Mar 2014 14:30:03 +0000 (16:30 +0200)]
plugin-resource-native: adjust dump buffer if needed.

10 years agolua-bindings: console commands for Lua GC and object dumps.
Krisztian Litkey [Thu, 20 Mar 2014 18:02:21 +0000 (20:02 +0200)]
lua-bindings: console commands for Lua GC and object dumps.

Added a console command for triggering, pausing, restarting and
reconfiguring the Lua garbage collector. Added another command
for dumping tracked active and dead Lua objects. You have to
enable Lua object tracking for this to show anything useful.

10 years agolua-bindings: override allocator earlier, use simpler block tracking.
Krisztian Litkey [Thu, 20 Mar 2014 17:12:41 +0000 (19:12 +0200)]
lua-bindings: override allocator earlier, use simpler block tracking.

Looks like in all hastiness I missed that it is indeed possible
to override the Lua allocator before it has been used to allocate
any blocks. So... instead of blaming the Lua infra for a non-
existing deficiency, let's try to use it correctly. Instead of
first creating the interpreter state and only then overriding the
allocator, let's use the state creation routine which also takes
the allocator to use as an argument.

In all fairness, it is IMO still a deficiency that the interpreter
lets a busy allocator (one that has unfreed blocks) be overridden
without storing and passing the used allocators userdata along
with the allocated blocks of memory.

Now correctly overriding the allocator with a tracking one at _any_
time has a pretty steep performance penalty. The allocator first
needs to check if a block has been allocated by it and otherwise
pass it on to the previously active one. This is what we used to do
before this patch. With this patch, we choose lower runtime overhead
for the price of less flexibility (can't enable tracking dynamically
at any time).

10 years agolua-utils: count active/dead objects per class.
Krisztian Litkey [Fri, 21 Mar 2014 13:56:19 +0000 (15:56 +0200)]
lua-utils: count active/dead objects per class.

Keep track of the number of active and dead objects per class.
This gives at least some idea/hint of memory consumption and
Lua object leaks even when object tracking is inactive.

10 years agolua-utils: allow object tracking to be enabled from the outside.
Krisztian Litkey [Thu, 20 Mar 2014 17:52:37 +0000 (19:52 +0200)]
lua-utils: allow object tracking to be enabled from the outside.

Added a function to enable/disable object tracking externally.
Currently this is used (in lua-murphy) to automatically turn on
object tracking whenever Lua memory tracking is enabled. Note
that once the first object has been allocated, the state of
tracking cannot be altered since it would have an effect on the
size of object userdata.

10 years agocommon: print total memory usage in mrp_mm_dump.
Krisztian Litkey [Thu, 20 Mar 2014 17:00:13 +0000 (19:00 +0200)]
common: print total memory usage in mrp_mm_dump.

10 years agoresource: don't assert if a resource-set dump does not fit the buffer.
Krisztian Litkey [Thu, 20 Mar 2014 11:22:22 +0000 (13:22 +0200)]
resource: don't assert if a resource-set dump does not fit the buffer.

Instead of asserting just make sure we don't overflow the buffer.
Additionally, if the buffer was too small for the full dump, add
a trailing '...\n' if that fits. When printed, this will provide
at least a visual clue about the insufficient buffer space.

10 years agoresource-native: allow overriding the default transport by an evironment variable.
Krisztian Litkey [Thu, 20 Mar 2014 11:21:25 +0000 (13:21 +0200)]
resource-native: allow overriding the default transport by an evironment variable.

10 years agoresource: allow overriding the default transport by an evironment variable.
Krisztian Litkey [Thu, 20 Mar 2014 11:20:31 +0000 (13:20 +0200)]
resource: allow overriding the default transport by an evironment variable.

10 years agosample-config: small typo/thinko fix. v0.0.50
Krisztian Litkey [Thu, 13 Mar 2014 11:36:56 +0000 (13:36 +0200)]
sample-config: small typo/thinko fix.

10 years agobuild-sys: install (and patch) the modularized sample configuration.
Krisztian Litkey [Thu, 13 Mar 2014 09:30:23 +0000 (11:30 +0200)]
build-sys: install (and patch) the modularized sample configuration.

10 years agobuild-sys: propagate also sysconfdir to the preprocessor.
Krisztian Litkey [Thu, 13 Mar 2014 09:29:09 +0000 (11:29 +0200)]
build-sys: propagate also sysconfdir to the preprocessor.

10 years agodaemon: honour overridden sysconfdir.
Krisztian Litkey [Thu, 13 Mar 2014 09:25:57 +0000 (11:25 +0200)]
daemon: honour overridden sysconfdir.

10 years agolua-5.2: added Lua specfile patches for 'peaceful coexistence'.
Krisztian Litkey [Sun, 9 Mar 2014 21:31:46 +0000 (23:31 +0200)]
lua-5.2: added Lua specfile patches for 'peaceful coexistence'.

Added two patches that allow Lua-5.2.x and Lua-5.1.x to co-
exist without conflicts with whichever version you happen to
have installed on your system. To get the additional version
installed, take the Fedora source RPM of the version you want,
patch its specfile with the patch in this commit, then build
and install. So rougly:

    rpm -ivh <uri-of-fedora-lua.src.rpm>
    patch -p0 < <patch-from-this-commit>
    rpm -bb ~/rpmbuild/SPECS/lua.spec
    rpm -ivh ~/rpmbuild/RPMS/<arch>/lua-*.rpm

10 years agolua-5.2: build-sys: allow building against a specified Lua version.
Krisztian Litkey [Sun, 9 Mar 2014 16:21:47 +0000 (18:21 +0200)]
lua-5.2: build-sys: allow building against a specified Lua version.

10 years agolua-5.2: resource: allow building against Lua >= 5.2.
Krisztian Litkey [Sun, 9 Mar 2014 16:21:26 +0000 (18:21 +0200)]
lua-5.2: resource: allow building against Lua >= 5.2.

10 years agolua-5.2: core: allow building against Lua >= 5.2.
Krisztian Litkey [Sun, 9 Mar 2014 16:21:06 +0000 (18:21 +0200)]
lua-5.2: core: allow building against Lua >= 5.2.

10 years agoresource-dbus: shared and mandatory property sigs 's' -> 'b'.
Ismo Puustinen [Mon, 10 Mar 2014 09:02:18 +0000 (11:02 +0200)]
resource-dbus: shared and mandatory property sigs 's' -> 'b'.

10 years agosample-config: don't load superfluous D-Bus plugin.
Krisztian Litkey [Fri, 7 Mar 2014 11:02:04 +0000 (13:02 +0200)]
sample-config: don't load superfluous D-Bus plugin.

10 years agodomain-control: fix an error message typo.
Krisztian Litkey [Fri, 7 Mar 2014 10:47:19 +0000 (12:47 +0200)]
domain-control: fix an error message typo.