libsysprof-profile: add API to list required policy

The idea here is that we stop having instruments do their own policy
checking and instead do the policy checking as a set from the recording
as part of prepare/etc.
This commit is contained in:
Christian Hergert
2023-05-25 16:43:56 -07:00
parent 2ae33917b2
commit ccdc1b8cff
2 changed files with 19 additions and 0 deletions

View File

@ -34,6 +34,10 @@ struct _SysprofInstrument
struct _SysprofInstrumentClass
{
GObjectClass parent_class;
char **(*list_required_policy) (SysprofInstrument *self);
};
char **_sysprof_instrument_list_required_policy (SysprofInstrument *self);
G_END_DECLS

View File

@ -24,12 +24,27 @@
G_DEFINE_ABSTRACT_TYPE (SysprofInstrument, sysprof_instrument, G_TYPE_OBJECT)
static char **
sysprof_instrument_real_list_required_policy (SysprofInstrument *self)
{
return NULL;
}
static void
sysprof_instrument_class_init (SysprofInstrumentClass *klass)
{
klass->list_required_policy = sysprof_instrument_real_list_required_policy;
}
static void
sysprof_instrument_init (SysprofInstrument *self)
{
}
char **
_sysprof_instrument_list_required_policy (SysprofInstrument *self)
{
g_return_val_if_fail (SYSPROF_IS_INSTRUMENT (self), NULL);
return SYSPROF_INSTRUMENT_GET_CLASS (self)->list_required_policy (self);
}