summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-02-08afb-stub-ws: Fix concurrent memory issuesflounder_6.0.5flounder/6.0.56.0.5José Bollo1-3/+4
This changes takes care to increment the the count of reference before using it. Bug-AGL: SPEC-2163 Change-Id: Ia7882427eeae933eeb5030aad025ebb1da129d6f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2019-02-06jobs: Ensure releasing event loopJose Bollo3-1/+32
The internal functions blocking threads for implementing call_sync were not releasing the event loop, leading to deafness of the binder. Include a tuto-4 that reproduce the issue on a binder with the bug and that also shows interesting usages of the binder. Bug-AGL: SPEC-2161 Change-Id: I83ad4d55d721a6046e798a5e06967df4dd5a7284 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2019-02-05jobs: Remove conditionnal REMOVE_SYSTEMD_EVENTJose Bollo3-128/+0
The removal of the systemd event loop will be made in later changes. Change-Id: I1ff707eee54d8aa3ae2e53cb8bbfa109e366185e Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2019-02-05jobs: Separate internal threads from othersJosé Bollo1-61/+92
Foreign threads, that are not started by jobs, are allowed to use synchronous jobs_call/job_leave (directly or indirectly). This commit ensure that those foreign thread will neither acquire the eventloop nor execute jobs. Includes a tiny cleanup of remain usage. Bug-AGL: SPEC-2089 Change-Id: I6d7caf30574cbca7ad56a6f4846a7d031de5cf95 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2019-02-05jobs: Refactor event loop handlingJosé Bollo3-125/+184
This improves the arbitration of the single event loop across threads. Before introduction of using 'evenfd' there was several event loop. At the current time, there is only one. At the end, there will probably remain only one. Bug-AGL: SPEC-2089 Change-Id: I1b40a11eee495cccfd3ed7a25ae6889042abd6bb Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2019-02-05afb-proto-ws: Serialize incoming messageJosé Bollo3-7/+6
Enforce serialisation for a connection Bug-AGL: SPEC-2089 Change-Id: I0e673c1efe5ef2317bb28dc05891004b71f2b2ae Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2019-02-05jobs: Fix a lock of call syncJose Bollo1-24/+59
Sometime the function jobs_leave missed to wake up the process that expected the result. It happened when that waiting thread was locked in the epoll. That commit unlock it. Bug-AGL: SPEC-2089 Change-Id: Ib4047e8c09f638655d83e7f2d0eeebe6c03cc69e Signed-off-by: Jose Bollo <jose.bollo@iot.bzh> Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2019-01-09docs: add yaml bookflounder_6.0.4flounder/6.0.46.0.4Frederic Marec1-0/+55
Bug-AGL: SPEC-1988 Change-Id: I1684c187d2b64128d5e032fd377831a204fd6b24 Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
2019-01-05Revert "jobs: Fix a lock of call sync"José Bollo2-60/+25
This reverts commit 821ed8ff1beabd10cf9b9046e41fb7e954ff93c0. Change-Id: I94c738c20a2526b7f6950a806c6ae1e65467fbf0
2018-12-31jobs: Fix a lock of call syncJose Bollo2-25/+60
Sometime the function jobs_leave missed to wake up the process that expected the result. It happened when that waiting thread was locked in the epoll. That commit unlock it. Bug-AGL: SPEC-2089 Change-Id: I6ab6a60a8c9ea3639143f282f90c7b77ed16853a Signed-off-by: Jose Bollo <jose.bollo@iot.bzh> Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2018-12-12afb-trace: Make real timestampsJosé Bollo1-10/+0
The optimisation that represent the timestamp as a fake double is not accurate in local context. Bug-AGL: SPEC-2051 Change-Id: I285837251507a69ad210823020d0cf69ad5999f3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-11-16afb-socket: Fix address reuseflounder_6.0.3flounder/6.0.36.0.3José Bollo1-7/+7
Change-Id: I3ae51611b92762a4f09b1f6cca6ff27853cd9f95 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-11-16afb-export: Fix error in event handlingJosé Bollo1-1/+1
Change-Id: I2869a2a840fb07550d493ddc2d651358892d33d1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-11-05genskel: Fix issues for C++ bindings v3flounder_6.0.2flounder/6.0.26.0.2José Bollo1-13/+64
The C++ compiler is too much strict. It doesn't accept valid C because fields are in the wrong order or missing. - afb_verb_t generated structure invert vcbdata and session - missing provide_class, require_class, require_api in the afb_binding_v3 generated struct The signature of the declared function was wrong. - wrong verb's callback signature void fun(afb_req) instead of void fun(afb_req_t) This add the declaration of the (pre)initialization and onevent functions. - missing init function signation generation, or probably preinit and onevent (not tested those ones) Bug-AGL: SPEC-1806 Change-Id: I1abf8a29f831ecc80458edcd3bd094b2108dc227 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-10-22monitoring: Fix naming of apisJose Bollo2-8/+8
The introduction of API v3 changed the API of monitoring/tracing. This introduced a regression of the monitoring: it wass not more possible to filter api by name. This fix that issue. Bug-AGL: SPEC-1828 Change-Id: Ic7f614f6c696119c7fd313e3cd252095f578c64c Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-10-22Make profile.d file consistent between rpm and debianSebastien Douheret2-8/+8
The file /etc/profile.d/AGL-app-framework-binder.sh must have the same name for all distro / packages, all the more that a reference of this file is given in the online documentation: http://docs.automotivelinux.org/docs/devguides/en/dev/ reference/host-configuration/docs/2_AGL_Application_Framework.html Change-Id: If3bd2d87bdce7af2f625eeb9a7b230f11520b9e9 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
2018-10-22afb-apiset: Reorder priority of messagesJose Bollo1-2/+2
The message before starting has now a greater priority than the one stating that start completed. Expecting that in case of problem it wil be cleaner. Change-Id: I2c27eb70f218d0492291c3eab4f8396ab5a6c093 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-10-12afb-api-so-v3: Keep root API in all casesJosé Bollo1-1/+8
For bindings v3, it is possible to have no explicit default root API. In that case, the binder creates a fake API that references the binding itself. That api isn't callable be it allows to emit messages, to catch events and to call services (other apis). It must be kept to ensure that there is no further error in the hypothetical case where it is used. Bug-AGL: SPEC-1812 Change-Id: I1a6c1e1390411a45521b9a6c1c386dc7807191df Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-09-14afb-session: Fix an issue in managing sessionsflounder_6.0.1flounder_6.0.0flounder/6.0.1flounder/6.0.06.0.16.0.0José Bollo1-2/+2
Probably an old copy/paste error in the commit d45426257d5149c735e33e3055220625a919e7bc It doesn't affect version EE (Electric Eel). Bug-AGL: SPEC-1735 Change-Id: Ia1536e141ac12275000196a3218eb62d77b36a06 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-09-12Version 6.0.0 aka "Funky Flounder"flounder_5.99.7flounder/5.99.75.99.7Jose Bollo1-2/+3
Change-Id: I6c7c55b1b77d70448be8df154b481757e6e063aa Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-09-10Add gitreview file for flounder branchJan-Simon Möller1-1/+2
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
2018-09-07afb-apiset: fixed the error message upon api open.flounder_5.99.6flounder/5.99.65.99.6Thierry Bultel1-2/+2
just a typo Change-Id: I2963c2568cffdc89f577e99f2280da6dcb732b04 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-09-06afb-session: Use ad-hoc pseudo-random uuidJose Bollo1-0/+50
The use of the generator given by the lib uuid implies the use of the system call 'getrandom' without the flag GRND_NONBLOCK. It has a weird effect on boot because many binders require the generation of uuid at the same time but getrandom is subject to starving. This introduced a tiny pseudo-random generation of UUID that does not implies the use of 'getrandom'. Bug-AGL: SPEC-1655 Change-Id: I5131072881d7a53f0edda9e36762985c96a04550 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-09-06VERSION 5.99.FFRC6Jose Bollo2-2/+2
Also add newline at end of .gitreview Change-Id: I826ecaf695a40dd883a690125fe8e2bffce1cd87 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-09-06Merge "main-afb-daemon: Export API after initialization"José Bollo3-5/+9
2018-09-05main-afb-daemon: Export API after initializationJose Bollo3-5/+9
Exporting API after initialization is a simple technic to avoid interleaving of incoming foreign calls during initialisation. Also a tiny fix in jobs.c and afb-socket.c. Bug-AGL: SPEC-1724 Change-Id: I59596256481c8afcd88755ec303bf7f881b55c12 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-31app-framework-binder doc: Changed doc to fit new format.flounder_5.99.5flounder/5.99.55.99.5CorentinLGS13-962/+23
-Split book.json in 2. -Deleted unwanted files. -Changed all links to .html files to .md files in the SUMMARY.md, it is used by gitbook to build the pdf and as gitbook doesn't handle .html files I had to change it. Change-Id: I15705ef0f0d9143971c046ccb72a4eee04b98890 Signed-off-by: CorentinLGS <corentinlgs@gmail.com>
2018-08-28Allow choice to trap or not program faultsJosé Bollo5-29/+110
The binder traps faults by default to recover as much as possible from unexpected errors. Developers may need to remove that behaviour to get core file. This introduces 2 ways to set or remove the trapping of faults: - the environment variable AFB_TRAP_FAULTS - the command line option --trap-faults Both take a boolean value set using on of the following words: 1 yes true on -- enable trapping of faults (the default) 0 no false off -- disable trapping of faults Bug-AGL: SPEC-1702 Change-Id: I6c6a3b933dbda9922a6079c390a601c533d49e55 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-28main-afb-daemon: Set AFB_ROOTDIR and AFB_WORKDIR in environmentJose Bollo2-3/+48
It may be difficult to retrieve the root directory from bindings and from process spawn by option --exec. In the same way, well identifying the workdir might interest programs or bindings. So, from now, the environment variables below are set: - AFB_ROOTDIR: identify the rootdir as set by --rootdir and in the context of AGL it will be the widget directory - AFB_WORKDIR: identify the workdir as set by --workdir To avoid any confusion, the function realpath is used to export absolute path names. Bug-AGL: SPEC-1694 Change-Id: Id272e009ca975e28aaab8b14fa2a98fbd2216e73 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh> Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-27afb-hook-flags: Fix a compilation warningJose Bollo1-1/+1
Change-Id: Ic9d1cc44ef1bbf6db4afe8eb7016b05f4cddb9a4 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-23jobs: Abort when systemd's event loop lostflounder_5.99.4flounder/5.99.45.99.4José Bollo1-1/+2
When sd_event_prepare returns an error there is currently no way to restore the event loop working. It happens when a callback of an sd_event is faulty (ex: SIGSEGV). In that case the monitoring of signals (sig-monitor) interfer badly with systemd. But at the the application firstly has error. To avoid flooding the journal with messages, aborting is the best solution. Bug-AGL: SPEC-1681 Change-Id: If01295f07b3c3fc8c8ec1ac5bf04840d42ee9774 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-23afb-stub-ws: Add reconnection of ws-clients on needJosé Bollo3-6/+67
This implementation detects deconnections and try to reconnect lazily on need. Bug-AGL: SPEC-1668 Change-Id: Ib2a20a4578f2da80afe1564c42de96c4aa250e64 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-23afb-stub-ws: Safe handling of deconnectionsJose Bollo3-134/+166
This commit also include many comments and improvements in naming of functions. Bug-AGL: SPEC-1668 Change-Id: I1b5dd95678d94e9edfca1c598c5697e90bb9e5bf Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-23afb-stub-ws: Process error on call to remoteJosé Bollo1-2/+6
Change-Id: I8bb96419cfac3da88e75da42c66a5d359ec7c666 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-23Send error replies on disconnectionJose Bollo5-12/+64
The pending calls receive an error notification when the server hang up. Bug-AGL: SPEC-1668 Change-Id: I052dca5e338a7650d7630856e21f1d3a81c6f265 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-23afb-wsj1: Split 'wsj1_on_text' in 2José Bollo1-23/+50
This improves the code and also prepare answering diconnected on server hangup. Bug-AGL: SPEC-1668 Change-Id: I2cf5a75bc2db6e9a0fd0cab88c7ff3cb9fd06242 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-23afb-stub-ws: Clean upJose Bollo1-10/+0
Change-Id: I6fbe737d4986fd18f9675942cd7ad75966125343 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-22afb-api-ws: Use afb-socket featuresJose Bollo1-92/+85
Use the feature of afb-socket to handle the api name. Bug-AGL: SPEC-1668 Change-Id: Ib13891d7948c75bc5d342b45c774f8e6c3ea016e Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-22afb-socket: ImprovementJose Bollo3-69/+194
Allows to either open a 'struct fdev*' or a int. This prepares further integration in afb-api-ws. Bug-AGL: SPEC-1668 Change-Id: I3d61be582bceaab636460b3c7de3ac2f24ed9473 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-22afb-stub-ws: Improve namingJose Bollo4-4/+4
The function afb_stub_ws_on_hangup is now named afb_stub_ws_set_on_hangup. Bug-AGL: SPEC-1668 Change-Id: Ie96c77d4af10ee6b42aea6f57d7c3aadb95e6467 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-22hello3: Add mutebugJose Bollo1-0/+6
The verb mutebug returns without answering but increment the reference count of the request. This has 2 weird effects: - on the service, it creates a memory leak - on the client, it creates a starve of answer Both effects are intended to test further improvements of the binder. Change-Id: I76ebe0dff1b42a8a72e1b3536857d1d1811452c1 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-22Set version to 5.99.FFRC4José Bollo1-1/+1
Change-Id: I8404d2cc83624eae755c39175e3096e024f30e24 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-20Provide functions afb_service_call[_sync]_legacyJose Bollo5-24/+144
These functions was missing and the documentation was erronous. This fixes that issue by providing the missing functions and updating the documentation. Bug-AGL: SPEC-1669 Change-Id: I543b0fbe29370be6f35f15ca3bfa48fef9ab4055 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-08afb-export: Provide the real path of the bindingflounder_5.99.3flounder/5.99.35.99.3José Bollo1-2/+6
The path can be a symbolic link. It must be resolved to be usefull. Change-Id: I5db247fd9925065684e036d8d458c2131006f9db Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-02Fix warnings and false errorsJosé Bollo3-3/+3
Change-Id: I434a0bd6be2758fd7964bc272d63dc280d400f47 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-02afb-export: Manage path of librariesJosé Bollo9-49/+87
This change allows a binding to know its installation path. This path is retrieved using the api function 'afb_api_settings'. The path is returned --if known-- as a string of key "binding-path". Change-Id: Ie1a349dc4936d4ccf173f1f77e118099f7f0599a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-02Add ability to provide binding settingsJosé Bollo16-40/+378
Change-Id: Iab93a26340fa9743a58ca43cd903bbf31c783e5b Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-02Improve parsing of json stringJose Bollo7-25/+46
Change-Id: I7100961ef8f8a75d623a0667178f191dd4cfb9d3 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-02afb-socket: Separate socket creationJosé Bollo6-167/+321
The objective is to have a well identified and possibly reusable internally. Change-Id: Icdb6ce7d85ae26373cfe4f0b492fe97b74ed747c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-02tic-tac-toe: improve event handlingJose Bollo1-15/+17
Change-Id: Ifba67b4b83650f9b32f78d077d0bbd3d3882238b Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>