aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-trace.c
AgeCommit message (Collapse)AuthorFilesLines
2019-04-02Fix false ***buffer overflow*** detectionJosé Bollo1-2/+2
The compiling option __FORTIFY_SOURCE=2 introduced a false ***buffer overflow*** detection when the flexible array 'pattern' was initilized in globset. The compiler is only complaining when the array is in a struct that is in a struct like struct { ...; struct { ...; char name[1]; }} To avoid these false detections, it is enougth to ellipsese the dimension of the array. Seems to be the now standard way of declaring flexible arrays when it was before an extension. So now: struct { ...; struct { ...; char name[]; }} works even when __FORTIFY_SOURCE=2. Bug-AGL: SPEC-2292 Change-Id: I4b4a5df505a5357f92b9ab1657175911198ca582 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-12-13afb-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-08-02Add ability to provide binding settingsJosé Bollo1-0/+20
Change-Id: Iab93a26340fa9743a58ca43cd903bbf31c783e5b Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-25afb-config: Rewrite the config as JSON objectJosé Bollo1-215/+9
Despite its poor performance, this changes is good at the end because: - it allows to put config in files - it removes dirty code to translate to JSON - it removes dirty code to dump the config - it unifies code for scanning hook's flag's names - it improves unity of naming between option's names and JSON's names Change-Id: I2487c8746d78a0cff80505a12b9fa60e40da9951 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-24json-c: Remove escaping of slashsJosé Bollo1-4/+7
By default json-c escapes the slashes. This is almost ugly and unuseful. But the resolution (with JSON_C_TO_STRING_NOSLASHESCAPE) was introduced lately by json-c. Integrate it as much as possible. Change-Id: Ia9c4bee78dc11df1ee9640cb04311991bd860e43 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-19afb-trace: Fix bug on uuid of session's eventsJosé Bollo1-1/+1
Change-Id: I4e4c2f337ae61a3399c7c97cfd028411f1471f98 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-19afb-trace: Fix bug in session handlingJosé Bollo1-1/+1
A copy-paste error! Change-Id: Iaf7bd9f3cbd62cddfbab04fecc685f334f983175 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-trace: Fix compiling error on old json-cJosé Bollo1-3/+4
Versions of json-c older than 0.12 doesn't have the function json_object_new_double_s. Change-Id: If34c36ddcfabb3796aeb6739cd150e2b3e763679 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-hook & afb-trace: Fix usage of readlinkJosé Bollo1-2/+6
The function readlink doesn't add a terminating null. This patch fixes that were needed. Change-Id: Ie15309471fe8203c8e98b97315c4ea30de3ccd75 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-13afb-supervision: Remove dependency to externalJosé Bollo1-1/+1
Also some cleaning in use of extern to allow accurate grep. Removing extern is better for linking and for structuration. Change-Id: I8121c4b9b34fa2737bffd2ecbe170d04d1d60ad1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-04afb-trace: Fix bug in tracing of afb_req_get_client_infoJosé Bollo1-1/+1
The utility wrap-json distinguishes o from O, the latest increment the reference count, as expected. Bug-AGL: SPEC-1563 Change-Id: I4490ac894059e47abf1e2474aab07249b862e985 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-19Fix a warning in using readlinkJosé Bollo1-11/+20
The use of the same buffer as input and output of readlink leads to warnings due to restrict use in new versions of GLIBC Change-Id: Ifbf1277b88bd18a9df1e18211d4248e94c16d6da Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-15api-v3: First draftJosé Bollo1-224/+367
This commit introduces the bindings v3 API for bindings. The documentation has still to be improved and will come very soon. Change-Id: I8f9007370e29f671fdfd1da87fff7372a17db7af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-13afb-trace: Restore microsecond timeJosé Bollo1-1/+1
This allow to use accurately float 64 bits for times from 1970 to 2112. Change-Id: I8f57a57edbf5469f827c0eeb80191de934d9841e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-13afb-hook: Refactor timestamps of hooks and traceJosé Bollo1-1/+1
Change-Id: Iebcab280123d1f954eda3b1260d0b984ae3a98b5 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-27Update date of copyright noticesJosé Bollo1-1/+1
Change-Id: If9d7e7728df086fbb7214f1de5cbec35cd2f1d9b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-22afb-supervision: Fix error on 'trace'José Bollo1-1/+1
Change-Id: I81c89e6c9406df583087845d6b38a19fff8ab0eb Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-13afb-trace: Add tracing of sessionsJosé Bollo1-15/+105
Change-Id: Ieba4032bed526ca158dc69558177a038df95988b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-06afb-trace: Replace daemon by api nameJosé Bollo1-7/+6
This replacement greatly improves the code. Change-Id: If3fd6e6080eda2268ccf551998f99af01799be29 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-11-06afb-session: fix reference countingJosé Bollo1-4/+8
Change-Id: If36c9210f0982ba35299de52f0c8fd96e7c836e2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-11-06afb-session: Add timeout features for sessionsJosé Bollo1-1/+1
Change-Id: I0aa8a82c0bbf709aa380ef7e5efe2e4ebaf454c0 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-11-06afb-session: add function afb_session_searchJosé Bollo1-5/+8
Also the function afb_session_get always create a session even if 'created' is NULL Change-Id: Ia5ac1231e1d61e92cb9bbc07c968e3000d6864ff Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-11-06afb-trace: improve and simplify session managementJosé Bollo1-70/+37
Change-Id: I828e0498bc68c9f1d1635a886e0a93fcb2d2389c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-10Add the function afb_req_get_uidJosé Bollo1-1/+9
Change-Id: I9caf38ee3811cf10b546489094f0bb5b3d844c40 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Improve naming of evt_eventidsJosé Bollo1-7/+7
Change-Id: I1fa3cf776110f67ad1b18c4c83f3a1707692ae8b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Provide API and VERB name of requestsJosé Bollo1-2/+2
Change-Id: I9a86c6314f871334231e50f9cea60b54aed434b9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Provide conversions for afb_event and afb_reqJosé Bollo1-2/+5
Provision is made here to convert, trivially: afb_event -> afb_eventid* afb_req -> afb_request* The opposite conversions aren't provided to favor new interfaces. Change-Id: Ib67c2317f782e2edfd1ba0e49e10b321a3b770a3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Deprecate internal use of afb_eventJosé Bollo1-9/+9
The deprecation is made in favor of afb_eventid but this can change later in favor of afb_evt_evtid. Change-Id: Ic16cb25dbd97cb1e8d26b3c54b159d46bbf82671 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Make afb_event_drop obsoleteJosé Bollo1-7/+0
The function is now replaced by the function afb_event_unref. In the same time, the function afb_event_addref is made available. Change-Id: I9aa30e80e64e82f3b16ab359982337771b287185 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-trace: Use the fresh afb_eventid internalsJosé Bollo1-11/+11
Change-Id: Ia9c840fb768bc058e74c32028b8a4817463177e4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-evt: prepare futur afb_eventidJosé Bollo1-6/+20
Change-Id: Ie4668c2dadbdfbe79bac2c27a1b188edecbcf847 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Atomic context initialisation for bindingsJosé Bollo1-1/+18
Change-Id: I3e81b64d57c917da1fba9b3a9387d0f4d7f3e6b7 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-trace: improve naming (minor)José Bollo1-4/+4
Change-Id: Ife42648b089d23d75820337e015703ee884d99fc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Add function 'afb_req_get_application_id'José Bollo1-1/+19
This function is intended to return an identifier of the calling application. At this time, the identifier is just derived from the application id but it can be changed in the future. Change-Id: Idacde8979ac5bb525352de9cab19e3fc1ed48627 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-export: refactor of binder interfaceJosé Bollo1-52/+51
The interfaces of the binder called afb_ditf and afb_svc are merged together to create the afb_export structure. Change-Id: I841ba04d7b2f94bfc19f691ec746d0bd221f164d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Remove tailing spaces and TODO fileJosé Bollo1-3/+3
Change-Id: Id7cdad4e24c6ab62bf9c325b542e1605b17223f4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07Improve handling of verbosity in bindingsJosé Bollo1-1/+0
The macro AFB_BINDING_PRAGMA_NO_VERBOSE_MACRO is removed. The macro AFB_BINDING_PRAGMA_NO_VERBOSE_UNPREFIX is removed. The macro AFB_BINDING_PRAGMA_KEEP_VERBOSE_UNPREFIX is now used to activate the weakly named verbose macros DEBUG, INFO, NOTICE, WARNING, ERROR. The macros AFB_BINDING_PRAGMA_NO_VERBOSE_DATA and AFB_BINDING_PRAGMA_NO_VERBOSE_DETAILS can be used to tune what verbose parts are to be emitted: If AFB_BINDING_PRAGMA_NO_VERBOSE_DATA is defined then the macro will only report the file and the line that emitted the message. This mode is intended to reduce the count of static data plugin the binary. If AFB_BINDING_PRAGMA_NO_VERBOSE_DATA is not defined and AFB_BINDING_PRAGMA_NO_VERBOSE_DETAILS is defined, this is the opposite: the messages are emitted but not the file, line and function. When none of these 2 are difened, everything is emitted: the message and the details. Change-Id: Ibb83cd435797fadf90626cb06bbda77f0f8b3cde Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31afb-trace: use constants for verbosity levelJosé Bollo1-1/+2
Change-Id: I0908c5057efe5360cccd3b2e1e3f926f48453bd2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29hooking: Add hook at global scopeJosé Bollo1-4/+77
Actually the global scope only allows to trace log messages. Change-Id: Ib73edf2e3168311b2ad694d857e6647e34884313 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29hook+trace: add a unique timestampJosé Bollo1-63/+60
A same event must have a unique time stamp. Change-Id: Id33351a97f62c04a84d26995a2cf9ae80613c613 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-29hook+trace: adds hookid and typeJosé Bollo1-112/+114
The hookid is a unic identifier for a hook event. Its purpose is to distinguish events that could match different filters: a same event has a same id. Also integrate the field "type" (of the event) in the trace event. Change-Id: I90b0b2d3a0846b673b993110d2752cc54db75bd8 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-08afb-trace: Add tracing features to API monitorJosé Bollo1-0/+1456
This api allows to receive events when particular actions are reached. At the moment, tracing is bound to the API monitor and can trace anything. In the future, this will not be the case and the API monitor will only allow to trace requests of its session. The tracing of all will be available for supervision only. Change-Id: I880852612c2f77ff5329496b16c75fe602db4090 Signed-off-by: José Bollo <jose.bollo@iot.bzh>