There were leftover temporal directories when using the OVNI_TMPDIR
variable, as we only remove the proccess ones. This change only attempts
to remove them if they are empty, and doesn't care about race
conditions. The removal process is just "best effort".
The metadata was being written to the final directory, which may be too
slow to accept writes during runtime. The thread metadata needs to be
written anyway at ovni_thread_free() to set the finished flag, so we can
simply skip it.
The emulator will now check that all threads are properly finalyzed by
calling ovni_thread_free(), as required by the specification. For now
only a warning is issued, which is enough to determine the cause of
potential emulator panics.
The ovni model is now always enabled.
Allows programs to update to a new libovni library without breaking the
instrumentation. Only until the first call to ovni_thread_require() the
models are enabled on demand.
Until now, emulation models were always being registered via probe(),
which causes the emulator to initialize all the channels. To reduce the
overhead, the channels were not connected or registered in the bay
until the first event of that model was received. This delayed connect
was causing issues in muxes where the newly connected model required
refreshing the touched channels. Which in turn was causing unexpected
PRV events.
By determining which models we need to enable, we can remove the delayed
connect mechanism and just enable those models at initialization time,
and connect the channels.
This commit introduces the OVNI_TRACEDIR environment variable to change
the directory where traces are generated. By default, when the envar is
not defined, the trace is still generated in the ovni directory. The
envar can take a trace directory name, a relative path to the directory,
or its absolute path. In the first case, the directory is created in the
current path $PWD.
Both libovni (rt) and ovnisync read this environment variable.
The public includes are now in include/ and in internal includes in
src/include/. The ovni* tools are moved to emu/ovni*.c and liked with
the emu static library.