Commit Graph

50 Commits

Author SHA1 Message Date
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
Vincent Torri f7c560c311 replace hton and ntoh family functions with ones defined in eina
Summary: This fixes especially the execution of edje_cc on Windows

Test Plan: execution of edje_cc

Reviewers: cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7834
2019-02-01 14:25:35 +00:00
Carsten Haitzler df9957a7c4 eina debug - fix 32bit warning for casting down to 32bit ptrs 2018-11-09 12:18:59 +00:00
Carsten Haitzler ea9ab2dd5a eina debug - fix buffer truncation warning
make buf the size of the unix socket path to truncate early to avoid
warning
2018-11-09 11:43:58 +00:00
Marcel Hollerbach cf74462b76 eina_debug: switch to vpath
Summary:
eina debug was using the xdg runtime dir in a wrong manner. Since the
directory should be only used by the user, and the directory should be
be subject of any other usage. Additionally, apps tend to create files
like: $XDG_RUNTIME_DIR/foo.bar which is probebly not what you want in
$HOME.

ref T7107

Depends on D6747

Reviewers: zmike, stefan_schmidt, #committers

Reviewed By: zmike, #committers

Subscribers: #reviewers, cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7107

Differential Revision: https://phab.enlightenment.org/D6748
2018-08-20 12:59:15 -04:00
Mike Blumenkrantz 7c50209baa eina/debug: remove global lock for session list access
this list is now only accessed from the main thread so there's no reason
to have a lock for it
2018-07-03 16:10:23 +02:00
Mike Blumenkrantz e7e1560e18 eina/debug: rework session thread destruction to avoid deadlock on shutdown
when debugging was active, this would frequently result in the monitor thread
blocking in a read() call for a fd which had already been closed by the main
thread. the main thread would be waiting for the monitor thread to fail its read()
and destroy itself, but the read() would never end without an interrupt

this reworks the monitor thread destruction to stop relying on the thread to
remove its session from the session list and instead only access the list from
the main thread, allowing sessions to always be immediately destroyed

fix T7103
2018-07-03 16:10:21 +02:00
Carsten Haitzler 194971342b eina debug - fix setuid process shutdown by initting fully except conn
init eina debug fully except for the debug daemon connection that the
setuid check was meant to skip. this fixes T7055
2018-06-27 14:13:00 +09:00
Mike Blumenkrantz 1de5c251d1 eina_debug: add function to reset debug subsystem after fork
fork() kills this entire subsystem and leaves its internals
in an inactive but allocated state, so it's necessary to explicitly restart
everything in order to guarantee behavior

@feature

Differential Revision: https://phab.enlightenment.org/D6307
2018-06-19 13:55:36 -04:00
Mike Blumenkrantz bd9edfad00 eina_debug: make shutdown perform cleanups and kill the timer thread
this should not remain active after eina has been deactivated, so ensure
that everything stops as expected

ref T7019

Differential Revision: https://phab.enlightenment.org/D6306
2018-06-19 13:55:36 -04:00
Mike Blumenkrantz d886b18fc3 eina: call eina_threads_init from eina_debug_init
eina is guaranteed to crash in any process without this call now that
eina_debug exists and requires threads

@fix

Differential Revision: https://phab.enlightenment.org/D6302
2018-06-19 13:55:36 -04:00
Mike Blumenkrantz 0e49bfda65 eina: don't init subcomponents inside eina_debug
this should be done in a single location to avoid dependency conflicts
and make the code easier to read

Differential Revision: https://phab.enlightenment.org/D6301
2018-06-19 13:55:36 -04:00
Carsten Haitzler 0ccf813112 eina debug - use pthread _sigmask instead of sigprocmask like elsewhere
elsewhere in efl we moved to pthread_sigmask but eina debug didn't, so
mirror the changes here too. at this point in time when we are
initting eina debug this shouldnt really matter much as we're single
threaded until this pthread_Create is called. after that tough...
we're not. signals + threads is a nightmare though... horrible
horrible...
2018-01-03 13:05:16 +09:00
Carsten Haitzler 31f8c6f17e eina debug - ensure sockaddr is 0'd out before filling in to avoid junk
valgrind does complain about this. i'm not sure it matters but it's
safer to 0 it out in case some field is being used that we don't think
is being used that we didn't set.
2017-10-29 11:19:48 +09:00
Vincent Torri 10ba064b65 Windows: remove XP support and forbid compilation and run on this platform
Test Plan: run on XP

Reviewers: jpeg, cedric, ajwillia.ms

Reviewed By: ajwillia.ms

Subscribers: ajwillia.ms

Differential Revision: https://phab.enlightenment.org/D5245
2017-10-01 18:09:46 +01:00
Carsten Haitzler a37e1e479d eina debug - add missing unlock in erite err case
fix CID 1381503
2017-10-01 16:04:35 +09:00
Carsten Haitzler 05b26102cf eina debug - check write return values and complain on failure
coverity - fix CID 1377521
2017-09-29 12:26:57 +09:00
Cedric BAIL 024c6a9fc3 efl: silent warnings shown on solaris due to missing header files. 2017-09-14 09:59:02 -07:00
Stefan Schmidt 79956eee63 eina: fix build for big endian platforms
Summary:
The code in eina_debug.c requires the eina_swapX() functions on big endian platforms, so include the required header.

Test Plan: Do build on big endian platform like ppc64 or s390x.

Subscribers: kubu, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5158
2017-09-11 14:08:41 +02:00
Carsten Haitzler 256450d294 eina debug - remove other swap and comment on the weirdness of this 2017-08-03 09:08:04 +09:00
Carsten Haitzler 470b48d63c eina debug - new debug infra - comment out and make a note on bad endian
bad endian... code... see the comment in the src about why i think
this is bad as obviously the buffer pointed to is a 64bit type always
that is a pointer to something...
2017-08-02 22:41:54 +09:00
Carsten Haitzler 573d0cf586 eina debug - set length after freeing/iterating over the keys
found by PVS studio
2017-07-31 10:03:59 +09:00
Carsten Haitzler d6785cfeb6 eina debug - if calloc for session struct failed - return NULL
makes analysers happy but really doesnt change anything - moves the
abort/crash/exit somewhere else.

found by PVS studio
2017-07-29 10:37:44 +09:00
Carsten Haitzler c69f9d2837 eina debug - check return value of syscall for errors
this should fix CID 1377550
2017-07-23 18:40:04 +09:00
Daniel Zaoui 0e947166aa Eina Debug: fix a bug resulting in registering opcodes twice
The opcodes registration request is sent directly in case the connection
is already made. Otherwise, the request is waiting for the connection to
be made by the dedicated thread (not the main loop).
That's why the request can be sent by the two different threads at the
same time, leading to send it twice. It means a callback for an opcode
would be invoked twice everytime a request with this opcode is received.

This patch fixes it by checking if the request has already been sent.
2017-06-11 09:44:57 +03:00
Al Poole a7e8dff3e4 eina: fix implicit declaration of pthread_set_name_np in eina_debug.
Summary: Checks and includes necessary headers (FreeBSD et. al)

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4949

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-08 13:36:25 -07:00
Cedric BAIL e83914d496 eina: silence gcc warning.
Code is correct and won't lead to a case where size is > 0 and buffer
isn't set, but gcc can't see the relation between both variable.
2017-06-05 12:07:57 -07:00
Daniel Zaoui c0eb231edb Fix Windows compilation
Thanks to vtorri for his help on this delicate issue named Windows
2017-06-05 08:55:38 +03:00
Daniel Zaoui ea50cbd2b3 Support endianness 2017-06-05 08:55:38 +03:00
Daniel Zaoui 9e47089311 Remove alloca of potential big size 2017-06-05 08:55:38 +03:00
Daniel Zaoui 253d3ffe44 Remove thread management
The handling to forward requests is let to the callbacks.
2017-06-05 08:55:37 +03:00
Daniel Zaoui 2ff96adcc1 Removes modules feature 2017-06-05 08:55:37 +03:00
Daniel Zaoui 6e93528f41 Init the communication with the daemon from the debug thread 2017-06-05 08:55:37 +03:00
Daniel Zaoui d6e3ab67db Replace shell remote connection with localhost TCP connection 2017-06-05 08:55:37 +03:00
Daniel Zaoui 36959014d3 Remove _session variable as it is not needed anymore 2017-06-05 08:55:37 +03:00
Daniel Zaoui 27228d3dc1 Add data to opcode registration callback 2017-06-05 08:55:37 +03:00
Daniel Zaoui 8babb55646 Add API to get/set data to session 2017-06-05 08:55:36 +03:00
Daniel Zaoui d970c855ea Add API to get the session dispatcher 2017-06-05 08:55:36 +03:00
Daniel Zaoui bb87302808 Clean code and add comments 2017-06-05 08:55:36 +03:00
Daniel Zaoui 76e5a8f268 Fix Coverity issues 2017-06-05 08:55:36 +03:00
Daniel Zaoui f5cbb61bf4 Add a better support of timers
Now, the timers are handled in one dedicated thread. Multiple timers are
supported.
2017-06-05 08:55:36 +03:00
Daniel Zaoui 39c6a9562b Add shell remote connection
This feature is essential to debug remote applications.
2017-06-05 08:55:36 +03:00
Daniel Zaoui 6ad0d6ab22 Free packet buffer outside of the dispatcher 2017-06-05 08:55:36 +03:00
Daniel Zaoui cd8b2fc66b Close file descriptor when the session is terminated 2017-06-05 08:55:36 +03:00
Daniel Zaoui 5f268ec26a First patch of the Eina Debug layer rewriting
Eina Debug is a new layer aimed for EFL debugging. It offers scalability
by allowing registration of operations not specific to EFL core.

The protocol is simple and the APIs try to provide as much
functionalities/freedom as possible.
2017-06-05 08:51:49 +03:00
Carsten Haitzler 9f32f83d45 evlog + efl dbug - add logging of cpu freq and cpu usage per thread
this runs a 1000hz (or as best the kernel will allow) polling system
monitor thread that will logg the cpu frequencies of all cores (linux
only) as well as cpu usage per thread. this leads to much more
information able to be logged from an efl app (any efl app).

@feature
2016-11-10 01:02:22 +09:00
Vincent Torri a75155d8ba eina, efl: add copyright notice.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-14 18:41:48 +02:00
Carsten Haitzler 7571020eb8 eina debug - add comments 2015-05-08 17:18:38 +09:00
Stefan Schmidt 5c1157d4ec eina_ddebug: Fix build for the case without all requirements for eina_debug
In eina_debug.h we only include the eina headsers when all defines are true
for backtrace, dlopen, unwind, etc. We still use Eina_Bool here when these
cases are not met. I just hit this case and failed the build.
2015-05-08 10:01:42 +02:00
Carsten Haitzler 664708b817 eina - start a much improved eina dbug infra and have eina_log use it
this makes eina_log give bt's for all error logs. this is very useful
in finding just where a problem happens. the problem int he past is
that these have not been too useful due to backtrace_symbols() being
"useless". thus use the eina_btlog tool i added too.

also started infra for a debug monitor that can use the backtrace
infra to collect runtime stats ANY TIME for a process (don't need to
run under a debugger).

@feat
2015-05-08 14:13:17 +09:00