tools: add gen-eventfilter.py
Generate event filtering code for lg2::commit from an input json
file, so that system integrators can create default filtering rules
to omit undesired events and errors from their systems.
Tested:
Used `log-create` to create an event and observed it. Modified the
default event filter as follows and saw log was not created.
```
@@ -3,6 +3,9 @@
"default": "allowed"
},
"errors": {
- "default": "allowed"
+ "default": "allowed",
+ "ids": [
+ "xyz.openbmc_project.State.SMC.SMCFailed"
+ ]
}
}
```
```
$ ./builddir/log-create xyz.openbmc_project.State.SMC.SMCFailed --json '{ "IDENTIFIER": "/xyz/openbmc_project/inventory/SomeSMC", "FAILURE_TYPE": "Timeout for the SMC" }'
```
Change-Id: Ib6041481075758b994bb27a816dbf5e9f26c2841
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meson.options b/meson.options
index 6f8bdb4..5b3ef17 100644
--- a/meson.options
+++ b/meson.options
@@ -48,3 +48,9 @@
choices: ['dbus', 'journal', 'both'],
value: 'both',
)
+
+option(
+ 'event-filter',
+ type: 'string',
+ description: 'Path to the event filter JSON file.',
+)