Dobby
3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Dobby plugin for granting access to system perfetto tracing in the container. More...
#include <PerfettoPlugin.h>
Public Member Functions | |
PerfettoPlugin (const std::shared_ptr< IDobbyEnv > &env, const std::shared_ptr< IDobbyUtils > &utils) | |
std::string | name () const final |
Boilerplate that just returns the name of the plugin. More... | |
unsigned | hookHints () const final |
Indicates which hook points we want and whether to run the asynchronously or synchronously with the other hooks. More... | |
bool | postConstruction (const ContainerId &id, const std::shared_ptr< IDobbyStartState > &startupState, const std::string &rootfsPath, const Json::Value &jsonData) final |
Adds bind mounts for the perfetto producer socket if it exists. More... | |
Public Member Functions inherited from PluginBase | |
virtual bool | preStart (const ContainerId &id, pid_t pid, const std::string &rootfsPath, const Json::Value &jsonData) override |
Hook function called after the container is setup, but before the init process is executed. More... | |
virtual bool | postStart (const ContainerId &id, pid_t pid, const std::string &rootfsPath, const Json::Value &jsonData) override |
Hook function called after the container is started and the init process is now running. More... | |
virtual bool | postStop (const ContainerId &id, const std::string &rootfsPath, const Json::Value &jsonData) override |
Hook function called after the container has stopped. More... | |
virtual bool | preDestruction (const ContainerId &id, const std::string &rootfsPath, const Json::Value &jsonData) override |
Hook function called just before the rootfs is deleted, this is called even if there was an error starting the container. More... | |
Private Attributes | |
const std::string | mName |
const std::shared_ptr< IDobbyUtils > | mUtilities |
const std::string | mDefaultPerfettoSockPath |
Additional Inherited Members | |
Public Types inherited from IDobbyPlugin | |
enum | HintFlags : unsigned { PostConstructionSync = (1 << 0) , PreStartSync = (1 << 1) , PostStartSync = (1 << 2) , PostStopSync = (1 << 3) , PreDestructionSync = (1 << 4) , PostConstructionAsync = (1 << 16) , PreStartAsync = (1 << 17) , PostStartAsync = (1 << 18) , PostStopAsync = (1 << 19) , PreDestructionAsync = (1 << 20) } |
Bit flags that should be returned by hookHints. More... | |
Dobby plugin for granting access to system perfetto tracing in the container.
For now this just bind mounts in the standard perfetto socket used for IPC.
|
finalvirtual |
Indicates which hook points we want and whether to run the asynchronously or synchronously with the other hooks.
For PerfettoPlugin everything is done in the postConstruction phase.
Implements IDobbyPlugin.
|
finalvirtual |
Boilerplate that just returns the name of the plugin.
This string needs to match the name specified in the container spec json.
Implements IDobbyPlugin.
|
finalvirtual |
Adds bind mounts for the perfetto producer socket if it exists.
[in] | id | The id of the container. |
[in] | startupState | The start-up state of the container (ignored) |
[in] | rootfsPath | The absolute path to the rootfs of the container. |
[in] | jsonData | The parsed json data from the container spec file. |
Reimplemented from PluginBase.