Commit Graph

351 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri e4af7c100c EINA API BREAK: no more individual modules init/shutdown.
Being able to indivually initialize individual modules was initially
"good", but at end it's putting complexities on users that would try
to "optimize" by doing just what they used, but in the end most people
would get them wrong, users would have to do lots of code and etc. At
the end it does not worth.

Most module init just register handful errors and log domains, so are
cheap. The exception is mempool users, that would dlopen() stuff, but
people that are concerned (embedded) can just compile those statically
in eina.

Since at the end any real application would use most of modules, we
actually end saving lots of function calls that would do nothing other
than increment a global counter.

I also did the init/shutdown use an array, making it easier to
maintain. The inital dependencies were analysed by a script I wrote, I
hope it's all right.

Please fix any breakages you find!



SVN revision: 42300
2009-09-06 22:21:56 +00:00
Vincent Torri 718873e00c shut down safety checks in the log module
Note : currently, because of a circular calls of
eina_log_init() and eina_safety_checks_init(), eina
is not correctly shut down. Imho, eina_log should not
depend on the safety checks module. That would mean
some fprintf in eina_log_domain_new(), eina_log_domain_free(),
eina_log_domain_register()and eina_log_domain_unregister().


SVN revision: 42292
2009-09-06 15:25:35 +00:00
Vincent Torri e780763aa0 shutdown array module
SVN revision: 42287
2009-09-06 08:39:04 +00:00
Gustavo Sverzut Barbieri 5846195caf eina_log: be able to disable function or line.
write down specialized cases for threads or not, function or file,
color or not. Maybe it's not even an optimization since we add yet
another indirection/function call, but each case is simpler.

 * EINA_LOG_FILE_DISABLE=1: disables show of file:line in
   stderr/stdout messages.
 * EINA_LOG_FUNCTION_DISABLE=1: disables show of function() in
   stderr/stdout messages.

one must not use the two options at the same time, if that's the case
code will ignore EINA_LOG_FILE_DISABLE=1 and use just function
disable.



SVN revision: 42272
2009-09-04 23:45:16 +00:00
Vincent Torri d56568b7f9 eina_log uses pthreads now (if enabled), so link libeina against pthread
SVN revision: 42248
2009-09-04 16:25:18 +00:00
Gustavo Sverzut Barbieri eef2d35ea6 eina_matrixsparse: loggify, install header, remove warnings and coding style.
* use eina_log
 * install eina_matrixsparse.h
 * remove unused variable
 * fix coding style issue reported by Vincent



SVN revision: 42246
2009-09-04 14:18:05 +00:00
Gustavo Sverzut Barbieri 643958705b eina_matrixsparse: welcome sparse matrix implementation and tests.
Sparse Matrix was implemented and tested by Rafael Antognolli and
myself in order to implement optimized large sparse matrix walk in
some products, one of them WebKit-EFL optimizations.

We have done extensive tests, with good code coverage. Similar to
lists/inlists, we keep pointer to last known element and similar to
iterators we keep reference to last accessed row and cell inside
rows. This allows fast sequential access (for i... for j... m[i,j]),
that is our most common usage case.

Rows are kept in a list, with cells inside that row as another
list. It's not similar to most book implementations where cells keep
reference to their sibling cells in other rows as well, we opted to
not do that to save some pointers and make algorithms simpler, still
do great for our use case.

This code was developed on behalf of our client, that wants to remain
unnamed so far. Thanks client ;-)



SVN revision: 42243
2009-09-04 13:43:44 +00:00
Gustavo Sverzut Barbieri e88b62b295 oops! thanks Vincent.
SVN revision: 42230
2009-09-04 03:52:05 +00:00
Gustavo Sverzut Barbieri 4d5fbb7742 loggify array.
this is the last eina module to be converted to eina_log! :-)


SVN revision: 42228
2009-09-04 02:35:24 +00:00
Gustavo Sverzut Barbieri 5ea9ceeafc eina_module must initialize eina_array as it is used.
SVN revision: 42227
2009-09-04 02:34:48 +00:00
Gustavo Sverzut Barbieri dfee09d6b0 make it easier to spot wrong users of eina_log_print()
SVN revision: 42226
2009-09-04 02:34:10 +00:00
Gustavo Sverzut Barbieri 9f8dfea129 loggify rectangle.
SVN revision: 42225
2009-09-04 02:11:44 +00:00
Gustavo Sverzut Barbieri 04489ec727 loggify stringshare, with extensive debug.
note that one can turn per module debug, for example:

   EINA_LOG_LEVEL=4 EINA_LOG_LEVELS=eina_stringshare:0 ./bla

will enable level 4 (debug) for all modules except eina_stringshare
that is forced to 0 (just critical messages).



SVN revision: 42224
2009-09-04 02:03:46 +00:00
Gustavo Sverzut Barbieri 21545b087a loggify stringshare.
SVN revision: 42223
2009-09-04 01:54:37 +00:00
Gustavo Sverzut Barbieri ecbff0cb75 loggify main.
SVN revision: 42222
2009-09-04 01:48:36 +00:00
Gustavo Sverzut Barbieri 8a2c84631c loggify list.
SVN revision: 42221
2009-09-04 01:43:50 +00:00
Gustavo Sverzut Barbieri 8ca1675c51 eina_error: deprecated old logging, move to eina_log.
SVN revision: 42220
2009-09-04 01:37:11 +00:00
Gustavo Sverzut Barbieri 2406791660 loggify benchmark.
SVN revision: 42219
2009-09-04 01:19:19 +00:00
Gustavo Sverzut Barbieri dac152772f loggify mempool.
SVN revision: 42218
2009-09-04 01:13:49 +00:00
Gustavo Sverzut Barbieri 253a9623e9 loggify eina_convert.
SVN revision: 42217
2009-09-04 01:03:27 +00:00
Gustavo Sverzut Barbieri eeb2d38d38 eina_log_vprint() for those that want to wrap it in other functions.
SVN revision: 42216
2009-09-04 00:57:09 +00:00
Gustavo Sverzut Barbieri 0dd3836c56 missing file, sorry.
SVN revision: 42215
2009-09-04 00:56:16 +00:00
Gustavo Sverzut Barbieri 07d2bde900 eina_safety_checks_init()
All these individual init functions are getting messy, some modules
lack them and it's easy to get inconsistent. Safety check needs error
and log, but these need safety checks as well, some modules (lalloc,
rbtree and others) use safety checks but provide no _init().

I want to know if we really gain something to init individual
modules. It should not be that expensive as init should not allocate
heavy resources and the recommendation is to call eina_init() so most
users will do that anyway.

If people agree I'll unmark all *_init() as EAPI and make them private
to eina lib.



SVN revision: 42214
2009-09-04 00:53:19 +00:00
Gustavo Sverzut Barbieri cee03dcb3c eina_log: CONVENTION BREAK!!!! automatically adds \n
Automatically add \n to messages. Since we use that prefix, there is
no use to allow messages without \n, it would look a mess.

Some logging systems may not require the trailing newline, for example
logging to xml or syslog, for those you don't need to ignore this char
if present.

Yes, this breaks convention, but better now than latter. And the
results are not so bad.



SVN revision: 42200
2009-09-03 01:39:45 +00:00
Gustavo Sverzut Barbieri 8024360138 eina_log: thread safe logging!
eina_log_threads_enable() and then get thread safe logging with
non-main threads being printed with special notation to easily spot
those.



SVN revision: 42199
2009-09-03 01:31:26 +00:00
Gustavo Sverzut Barbieri d8ee1b3a24 eina_log: fix error handling and handle deleted domains.
EINA_SAFETY_CHECKS will call eina_log, so calling these from inside
eina_log_print() may lead to recursion, that is really bad (although
it seems it would never lead to infinite recursion).

handle d->deleted, also showing error.



SVN revision: 42198
2009-09-03 00:17:27 +00:00
Gustavo Sverzut Barbieri 9fb9b1259d eina_log: fix stderr, improve log output.
* stderr logger was doing prefix properly but user message to stdout, fixed.
 * log is improved:
   * grep-able, it shows the 3 letter level name as prefix, unknown levels
     will have their number printed.
   * colors just on prefix, less polluted output still easy to spot.
   * function names are highlighted.



SVN revision: 42197
2009-09-03 00:07:25 +00:00
Gustavo Sverzut Barbieri 418c99a8e3 eina_log improvements: docs, micro optimizations and stderr logging by default.
* more docs.
 * do not getenv("EINA_LOG_ABORT") everytime, just at init.
 * EINA_UNLIKELY() in some critical paths (not that big impact anyway)
 * eina_log_print_cb_stderr() and use it by default.




SVN revision: 42196
2009-09-02 23:28:00 +00:00
Gustavo Sverzut Barbieri bb717a3be5 less malloc and memory fragmentation.
not that important, but an easy improvement does not hurt.



SVN revision: 42195
2009-09-02 23:11:22 +00:00
Gustavo Sverzut Barbieri 2f8ded1037 loggify eina_module, adding couple of debug info.
SVN revision: 42194
2009-09-02 23:06:55 +00:00
Gustavo Sverzut Barbieri c1e2a300e4 coding style/indent.
SVN revision: 42193
2009-09-02 22:39:41 +00:00
Cedric BAIL 49cb141f10 * eina_magic: Test suite now work when magic debug is disabled.
SVN revision: 42150
2009-09-01 12:17:13 +00:00
Vincent Torri 8f53c520a4 typo
SVN revision: 42091
2009-08-29 20:53:12 +00:00
Vincent Torri 2a5548f8e9 better fix : if HW_AVAILCPU is defined, we use it, otherwise we use HW_NCPU
SVN revision: 42090
2009-08-29 19:59:26 +00:00
Vincent Torri 841aaa8f52 typo
SVN revision: 42089
2009-08-29 19:29:30 +00:00
Vincent Torri 9f01ad25cf fix for the BSD systems
SVN revision: 42088
2009-08-29 16:39:59 +00:00
Vincent Torri 72b87160a2 * add eina_config.h in all source files. Fix linking with Visual Studio
* move eina_private.h and eina_safety_checks.h just after eina_config.h


SVN revision: 42077
2009-08-28 12:03:34 +00:00
Vincent Torri 5612cf9020 * declare variables at the beginning of the block
* strtol returns a long int

SVN revision: 42063
2009-08-28 07:21:35 +00:00
Vincent Torri bc6ee8c17a fix warning with vc++
SVN revision: 42062
2009-08-28 07:15:49 +00:00
dieb c891a34a08 Add eina_log module into the main module and global header.
SVN revision: 41985
2009-08-25 21:26:27 +00:00
Gustavo Sverzut Barbieri c8534587f2 do not check for data, eina_iterator_next/eina_accessor_data_get() does that.
SVN revision: 41984
2009-08-25 21:05:00 +00:00
dieb d7bbc05b12 Initial import of the new eina logging API.
* eina_error might be kept for error messages and codes, but it's logging API
  will be deprecated. For now, it's been kept for not breaking others code and
  for a smoother transition.
* Added test for new logging API, also demonstrates usage.


SVN revision: 41960
2009-08-24 21:43:48 +00:00
Vincent Torri 37fc8c9674 fix warning
SVN revision: 41943
2009-08-23 20:37:17 +00:00
Vincent Torri 6e7aecc7c0 * Put definition of alloca before any standard header
files according to the doc
 * define _GNU_SOURCE before the inclusion of alloca
   as features.h inclued by alloca.h, defines some
   macros according to _GNU_SOURCE.



SVN revision: 41940
2009-08-23 09:18:14 +00:00
Vincent Torri 989ade86dd fix a bit the documentation
SVN revision: 41870
2009-08-19 07:54:13 +00:00
Vincent Torri 2d97e95d2a clean a bit the hamster
SVN revision: 41869
2009-08-19 07:36:39 +00:00
Cedric BAIL 0b7407905c * eina_rectangle: Add a local cache to rectangle creation.
SVN revision: 41856
2009-08-18 13:35:33 +00:00
Gustavo Sverzut Barbieri 425ebc47f5 improve docs and simplify macro, by kubo.
Kubo just found that docs could be improved and macro could be
simplified during his learning of EFL. Big bonus he did the
improvements =)



SVN revision: 41799
2009-08-16 00:47:23 +00:00
Cedric BAIL c634e07770 * eina: Fix typo.
SVN revision: 41762
2009-08-14 14:22:25 +00:00
Carsten Haitzler 819c572d1c amazing time hamsters!
SVN revision: 41728
2009-08-13 01:26:08 +00:00