Commit Graph

1329 Commits

Author SHA1 Message Date
Wonki Kim a8d7816782 docs: fix to make docs contain proper images
Summary:
links to images that this patch is modifying would be included in doxy docs
without pre or post process something in meson definition, if we applied this patch.

Reviewers: segfaultxavi, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10821
2019-12-10 12:53:39 +01:00
Stefan Schmidt d0f69cf2e2 exotic: remove left-overs from Exotic support
This seems to have been gone a long time ago and only references left
that have not been disturbing the build. Time to clean up!

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10793
2019-12-04 12:21:28 -08:00
Stefan Schmidt f3d9b8ee70 esacpe: remove library from tree
This has not been used for a while and is not even buildable after our
switch to meson. It was a niche to start with given that it needed the
PS3 OS to run on. I asked for any remaining users at EDD and on the list
but heard nothing. Time to remove.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10778
2019-12-04 12:21:24 -08:00
Carsten Haitzler 7787b16e20 eina - threadqueue - revert series of comments that moved to mempools
Revert "eina: remove no longer used function _eina_thread_queue_msg_block_real_free"
This reverts commit 695b44526c.

Revert "eina/threadqueue: use mempool_del for hash free function"
This reverts commit b0cb3b935a.

Revert "eina_thread_queue: use normal mempools for block allocation"
This reverts commit 14ae3e3dec.

Why? Threadqueue is a highly performance sensitive API.
_eina_thread_queue_msg_block_new() may be called quite often. Doing a
hash lookup to then find a mempool handle to then allocate from was
not the same as what was there and was going to be far more costly.
This would have actual performance impact as we have to compute a hash
and rummage through a hash, hunt for an environment var too. The
original code looked at a spare block pool where blocks *MAY* be of
different sizes (not always the same size so using a mempool is
actually wrong and will stop threadqueue from being able to send
larger messages at all). If you send large messages, larger blocks would
have been allocated and put in this pool. In almost all cases the first
item in the pool would be big enough so we don't hunt and the find pulls
out the first memory, resets the fields that are needed and returns that
block. If it needs a bigger one, it does hunt. This is going to be
rare that such big blocks are needed so I never tried to optimize this
(but it could be done with an array of sizes to make a walk to find
the right sized element cheap if the need arises).

Performance dropped quite a lot. On aarch64 The above mempool usage
dropped message rate from 1037251 msg/sec to 610316. On x86 it was even
worse. It dropped from 2815775 msg/sec to 378653.

So backing this out sees the message rate is 7.4 times faster and on
aarch64 it's 1.7 times faster.

So moving to a mempool was actually just wrong (size is not always the
same). Also this ended up with a mempool of 64k for thread queue blocks even
if we only sent messages sporadically, as opposed to a single 4kb
block. So backing this out saves memory by only having 1 or 2 4k blocks
around most of the time, not a 64k mempool.

So the above patch then follow-on patches were done without accounting
for the performance implications. There were good reasons to do what I
did - because this code was highly tuned even to the point where I
used atomics instead of locks specifically to cut down some contention
overhead. Beware when you change something that there may be steep
performance implications. 7.4 times faster to go back to what was
there is a great example.
2019-12-03 11:45:42 +00:00
Carsten Haitzler 1127409564 eina - add portable close all fd's we don't need function
close all fd's starting at a given fd and then leving out an exception
list specially passed, if any. useful for fork+exec. this uses it in
efl's fork+exec paths.

@feat
2019-11-27 16:52:49 +00:00
Wonki Kim 4a4525cb4b eina_matrix: replace cosf by cos to gain more accuracy
Summary:
cos function is much much more accurate than cosf.
this patch replaces cosf by cos to gain more accuracy.

Reviewers: cedric, jsuya, vtorri

Subscribers: vtorri, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10695
2019-11-21 17:50:33 +09:00
junsu choi 3493a37db8 Eina_Matrix : Use math header for cosf and sinf of rotate function.
The local cos and sin functions differ from
the math header cos and sin functions by result values
The 4th decimal place is different.
Computing large numbers can cause errors.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10467
2019-11-15 11:52:01 -08:00
Marcel Hollerbach f47b927745 efl_canvas_animation_rotate: adjust API
Summary:
in task T8288 we concluded that a few APIs need to be adjusted in order
to stabelize animation classes at some point. This also adds a new macro
to eina in order to create EINA_VECTOR2 values more easily.

ref T8288

Reviewers: Jaehyun_Cho, segfaultxavi, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8288

Differential Revision: https://phab.enlightenment.org/D10350
2019-11-04 13:06:53 +01:00
Cedric Bail 2f1894d054 eina: only the type need to be NULL to assume EINA_VALUE_EMPTY.
This avoid comparison with potentially uninitialized byte.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10479
2019-10-31 14:52:41 +01:00
Cedric BAIL efbc90ff87 eina: make use of the new near allocation policy for Eina_List.
The idea is to improve memory locality and hopefully get better cache hit
in general.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10536
2019-10-30 08:14:28 -07:00
Cedric BAIL fb5cf01977 eina: introduce an API for requesting memory near already allocated memory from an Eina_Mempool.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10535
2019-10-30 08:14:27 -07:00
Mike Blumenkrantz f4019d3303 eina: add comparison macros for Eina_Size2D and Eina_Position2D
Summary:
I'm tired of typing all this out. it's exhausting.

also add a couple usages internally to verify that this works as expected

@feature

Reviewers: cedric, bu5hm4n, devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, bu5hm4n, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10557
2019-10-29 14:52:58 -04:00
Daniel Kolesa 079b1f05b1 eina: remove eina_config.h.in
This is never actually used since meson generates eina_config.h
from scratch. Apart from the byteswap checks done in the previous
commit, all of the other things already seem to be done by meson,
so just remove it.
2019-10-23 15:51:34 +02:00
Daniel Kolesa 84251f9f00 eina: unbreak byteswap checks
For one, eina_config.h.in is never used by anything since meson,
so doing any checks in it and expecting them to work is wrong.
Byteswaps are one place where this is the case, so move the
checks back in their appropriate place.
2019-10-23 15:51:08 +02:00
Daniel Kolesa 038539176c eina: fix network byte order swap funcs on big endian 2019-10-22 10:59:42 +02:00
Mike Blumenkrantz c81e4d5080 eina/convert: init endptr in failure case of eina_convert_strtod_c
Summary:
there is not any way to determine that this function has failed other
than to check this pointer, so ensure that it always has a value which
is meaningful in failure cases

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10445
2019-10-18 13:29:32 -04:00
Mike Blumenkrantz cd97c2a0b7 eina/list: move dead code inside corresponding #ifdef
Summary:
this is debug code

CID 1404753, 1404745
Depends on D10204

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10205
2019-09-26 17:59:29 -04:00
Vincent Torri e79d6bd0af eina_array: do not mix declaration and definition
fix warning when used in C90 code.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10077
2019-09-23 16:43:54 +02:00
Marcel Hollerbach b6c713c937 eina_log: ensure that we do not spam journald with our intree binaries
EFL_RUN_IN_TREE is set for all binaries that are executed during build
time, and test suites. With this commit we are ensuring that we are not
sending messages during that time to journald, otherwise we would waste
a lot of time + we would create a lot of unneccessary log messages.

(eina test suite runtime with journald hook: 11.21s without journald
hook: 0.57s)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10076
2019-09-23 15:52:27 +02:00
Marcel Hollerbach 5ff0c3cc15 eina_log: do not fallback to INFO when we run with systemd support
INFO is a way too verbose log domain, this lead to the fact that we
spammed journald before the first frame with ~200-300 messages
(depending on the setup) which is quite a lot. Additionally, this also
lead to the fact that we often TIMEOUT our own tests.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10075
2019-09-23 11:50:43 +02:00
Cedric Bail 2fdad92948 eina: add code to help debug leaking Eina_Value.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9942
2019-09-19 14:37:43 -07:00
Cedric Bail 9382bfc0bc eina: add eina_mempool_iterator_new to slowly iterate every allocated pointer in a mempool.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9941
2019-09-19 14:37:41 -07:00
Cedric Bail 94e9363649 eina: prevent leak of Eina_Value internal allocation.
eina_value_copy assume the given Eina_Value as target is not initialized
when it copy the source in it. In eina_value_reference_copy we were initialising
before calling eina_value_copy which would then override and leak the internal
pointer no fault of the users.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9943
2019-09-17 10:24:08 -07:00
Stefan Schmidt 1d0a636953 eina: fix spelling in new eina_file_statgen API
Introduced in 9b294d6284 the new eina_file_statgen_* API has a typo in
its disable function. Fixing this before it gets out into a release.

Thanks goes to the https://abi-laboratory.pro service for offering their
great API/ABI reports to the open source communities to help finding such
things!

Differential Revision: https://phab.enlightenment.org/D9962
2019-09-16 12:02:42 +02:00
Wonki Kim 979757c845 eina_vpath: add null checking logic on vpath_resolve api
Summary:
there is a patch that add vpath_resolve() call before eina_file_open()
because `path` arg could be NULL, the patch kills some applications.
this patch add null checking logic on vpath_resolve api

Reviewers: bu5hm4n, cedric, Hermet

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9748
2019-08-27 20:25:02 +09:00
Wonki Kim 4c489d5a2e eina_list: fix to check a null argument
Summary:
data should be checked regardless of EINA_MAGIC define,
because it is dereferenced in the following logic.

Reviewers: cedric, bu5hm4n, Hermet

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9750
2019-08-27 20:23:29 +09:00
sub.mohanty@samsung.com 5bd95c9850 eina/array: added eina_array_find() api to eina_array.
Summary: updated test suite for testing the api.

Reviewers: zmike, Hermet, cedric, segfaultxavi

Reviewed By: zmike, segfaultxavi

Subscribers: segfaultxavi, ProhtMeyhet, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9734
2019-08-26 08:31:08 -04:00
Carsten Haitzler 2be2c3c6c3 eina list - make eina list magic optional and for now turn it off
this should bring our list nodes back to 32bytes (or 16 on 32bit)
which is the rounded up libc allocation size anyway expected. less mem
usage but less safety. i haven't seen any magic complainets to do with
eina list for a while now... so let's see.
2019-08-21 20:02:24 +01:00
Vincent Torri 01b987df59 make mman.h private
Summary:
integrate mman.h to make Evil private to the EFL, as mman.h does not exist on Windows. After a discussion with raster, i include sys/mman.h only on non Windows platform.

One issue, though, is that src/modules/emotion/generic/Emotion_Generic_Plugin.h has inlined functions using mmap()

Test Plan: compilation on Windows

Reviewers: cedric, raster, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9542
2019-08-19 09:55:13 -04:00
Carsten Haitzler 807c8e7357 eina file - don't double unlock a lock
thanks to coverity - found this double unlock path in case of error.

fix CID 1403899
2019-08-11 12:47:38 +01:00
Carsten Haitzler fd48be23c2 eina file - make coverity happy and lock+unlock on init
coverity doesnt like inconsistent behavior of code, so make it
consistent even  if pointless as this is during init when we wont have
threads .... yet.

CID 1403903
2019-08-11 12:47:38 +01:00
subhransu mohanty da39f53b95 eina/hash: optimize eina_hash_find() when hash is empty.
Summary:
Check if hash is empty before computing the hash key and look inside the
hash to find data.

Note: could have called the eina_hash_population() api but didn't
      because of extra function call.

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9531
2019-08-09 14:00:03 +09:00
Carsten Haitzler 9149767184 getenv - reduce continually calling getenv for the same vars do once
do it once and remember the result from the first one. drops overhead
for sure by a chunk i actually could see in perf reports like about 1-2%
of cpu...
2019-08-08 23:57:02 +01:00
Carsten Haitzler 5f1e44ddad eina log - we exceet 24 domains alrready out of the box, so increase
this avoids more reallocs since we already use more than 24 domains...
go up to 64.
2019-08-07 21:20:00 +01:00
Carsten Haitzler 9b294d6284 eina file - stat generation inexactness support
this is a performance optimization. it brings in a "stat generation".
for now it's disabled by default so we retain previous behavior. this
stops eina file from opening and stating a file every time you open
... it only does it if stat generation is off, or, if the generation
changed since the last time it opened that file. this makes cache hits
not have a 3 syscall cost (open+fstat+close). this optimizes that
lower end of things path. but .. it comes at a cost. if the file
changes before generation ticks over (which this forces to tick over
every time the loop exits idle by default).

now here is something to ask.

1. should we have this on by default and accept the "inexactness"
since you can eina_file_statgen_next() before any call that would do
i/o to force it to look at the real file stat info...
2. should we tick over every idle enter OR every N idle enters  or
every frame we render instead? ... i want to avoid getting a timestamp
or having a timer interrupt often... so what should we do?

at least this introduces the idea, some api's and an env var to turn
this on. it definitely cuts down syscalls during things like creation
of widdgets or objects in large batches etc.
2019-07-28 11:51:15 +01:00
Vincent Torri a6ade14c5e Evil: remove pwd code in Evil and fix compilation failures after the removal
Summary: remove pwd code in Evil

Test Plan: compilation

Reviewers: zmike, cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9420
2019-07-28 09:27:27 +01:00
Vincent Torri 04848c98f2 Eina: define EINA_HAVE_DEBUG_THREADS only if backtrace() in execinfo.h is available
Summary: fix compilation on systems where backtrace() in execinfo.h is not available

Test Plan: compilation on Windows

Reviewers: zmike, cedric, raster

Reviewed By: cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9392
2019-07-28 09:21:53 +01:00
Carsten Haitzler d19e435ff9 reduce syscalls on opening files - roll CLOEXEC into open
on linux open supports() O_CLOEXEC. add test case for this in meson
build and ifdef. this rolls 3 syscalls into 1 as we were doing open,
then fnctl to get and fcntl to set flags.

less syscalls is a good thing as syscalls are not cheap on some
architectures or systems. I've seen a syscall on 1 system take 2-3x
as long as another and another syscall in the same 2 system
comparison take 10x as long. depending on the syscall you may only
have a budget of something like 5000 syscalls "per frame" (60fps)
before you spend all of your frame time just in syscalls not
doing any processing, so we should keep these down if possible
and that is what this does.
2019-07-26 11:43:17 +01:00
Carsten Haitzler 0cd5427c3f build - cmake files - remove old seemingly unused cmake files 2019-07-24 17:53:09 +01:00
Mike Blumenkrantz 481747ae33 meson: fix debug-threads option
it doesn't matter if this doesn't work with eina_debug since this isn't
meant to be used for that kind of debugging

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9359
2019-07-19 15:04:48 -07:00
Vincent Torri 89db9df2d2 Eina vpath: remove support of ~username vpath on Windows
On Windows, one must be in kernel mode to obtain informations of other users

Reviewed-by: Carsten Haitzler (Rasterman) <rasterman.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9339
2019-07-18 09:36:25 +02:00
Cedric BAIL c46a814391 eina: set EINA_VALUE_EMPTY during library init.
This is a work around compiler/linker limit on some system as reported
by Romain Naour.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9348
2019-07-17 14:23:09 -07:00
Mike Blumenkrantz 662572ecfe eina/hash: add direct variants of list append/prepend functions
Summary:
this simplifies the process of manipulating lists inside hashes with a
non-copied key

@feature

Depends on D9205

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9206
2019-07-10 14:40:42 -04:00
Marcel Hollerbach 223a433be8 eina: add accessors for c arrays
This adds a new API which can be used to get access to a carray via the eina_accessor API.
2019-07-03 07:41:05 +02:00
Marcel Hollerbach bed3fa5904 meson: remove unneeded install: flags
Summary:
when install is not set, meson take the value of install_dir. So when
this is removed, things will continue working correctly.

Reviewers: zmike, stefan_schmidt, cedric, segfaultxavi

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9065
2019-06-03 08:46:29 -04:00
Cedric BAIL 2a3bf30abc eina: add eina_slstr_copy_new_length.
Reviewers: SanghyeonLee, bu5hm4n, zmike, segfaultxavi, lauromoura, felipealmeida, raster

Reviewed By: bu5hm4n, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7832

Differential Revision: https://phab.enlightenment.org/D8800
2019-05-29 13:49:26 -04:00
Mike Blumenkrantz 9c2547db0c eina/prefix: ignore magic files when running in tree
Summary:
this just can't work.

@fix
Depends on D8951

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8952
2019-05-29 12:29:03 -04:00
Mike Blumenkrantz 655c816539 eina/file: use INFO log level when eina_file_open fails
Summary:
this function is commonly used to detect the existence of files using
its return value. for this purpose, printing warnings any time the file
cannot be opened is spammy and not very helpful in the context of detecting
actual errors.
Depends on D8950

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8951
2019-05-29 12:29:03 -04:00
Marcel Hollerbach 1f0ae2e349 eina: move builtin detection to eina_config.h
Summary: this means we don't need to handle this in the buildtool at all.

Reviewers: vtorri, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8553
2019-05-21 12:28:47 -04:00
Vincent Torri ce9cad3a3b Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary
Test Plan: compilation

Reviewers: raster, zmike, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8903
2019-05-16 13:48:59 -04:00