Closed atenart closed 1 year ago
In general, having a unified API seems an interesting idea that we should explore. However, right now
retis::Retis
is "just" encapsulating aEventFactory
(which actually has to be constructed externally), and aProbeManager
, which in fact, is only used on certain cases (only onretis collect
). Do you think we'll add more things to it?
I'd like to move the kernel inspector here too, and at some point we'll probably add the ability to retrieve information about kernel modules. Also if we allow access to the tracking info this will land in there.
I agree the current scope is not that big, but I'm thinking it has two advantages:
If the goal is to unify, why not put
modules
inside as well?
See below,
We keep 3 high level objects:
core::Retis
,cli::*
andmodule::Modules
. It makes sense as those represent the 3 main elements we are dealing with and their separation helps in multiple ways:
They can't be grouped in Rust: we need to iterate over modules or over cli arguments while using the main API object (
Retis
).Depending on the consumer, only a combination of those 3 objects is required.
To sum up, there are two main points:
for module in retis.modules.collectors() {
module.init(&mut retis)?;
}
Thoughts?
Following our discussion on how to unify and consolidate the API, here are 3 patches based on top of #102 to start the discussion. The design for this initial work is as follow:
core::*
APIs were unified into acore::Retis
object.core::Retis
,cli::*
andmodule::Modules
. It makes sense as those represent the 3 main elements we are dealing with and their separation helps in multiple ways:Retis
).