| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Add constants for use with std::get.
Tested: Run unit tests
Change-Id: Ic09c13feeda69d61c98f63d227cae8f08d1bf50e
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This callback class will create an error log with
exactly 1 metadata field, which takes a string. This
metadata field will be filled in with the property paths,
names, and values of the properties that passed the
condition checks that caused the callback to be called
in the first place.
Tested: Ran with YAML rules that used this callback and
checked that everything worked as specified.
Change-Id: Ib37206c63385939c583a09e7ba979d6e016691f6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
std::function is not found with a GCC 7.3 runtime.
Change-Id: I4e5289794d405c42ab6291c211289d1ab175b197
Tested: Built repository with GCC 7.3
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The CountCondition class checks each property in its
index against some condition. Save the result of each
of those checks in the 2nd tuple element of the storage
entry for that property so that other code may access it.
Tested: Build and run unit tests
Change-Id: Ie99f02062c28d003e588a43bf042ecd2834ad9b2
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This array was originally just an array of objects of
type 'any'. This commit changes it to be an array of
tuples of type <any, any> to add an extra field for
use by anything that needs it.
For example, the storage is currently used to store
property values, and a future change to the CountCondition
class will now also store the result of the comparisons done
between the property values and another value specified in
the rule YAML. Then, a callback will be able to see the
result of whether each property passed the check.
Tested: Build and run unit tests
Change-Id: I58f32c9f4068b15a02b1ff7f28871161cafebddb
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a count condition is a oneshot, it will only
trigger the callback the first time the condition
is true. The condition needs to evaluate to false
at least once to rearm the callback.
A use case for this would be when a group of properties
is being watched for a subset of them hit a certain value.
Even though every properties changed signal for every property
in the group would check the condition, only the first time
the condition is true would the callback be issued.
This behavior is specified with a 'oneshot: true' entry in
the YAML. If not present, it defaults to false which is
the original behavior.
Tested: Verify this does indeed do what is advertised by
modifying condition rules to consistently pass
and checking behavior.
Change-Id: Ie185621e86c605234bf329a5f38317267dbb6fb6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Delete the oldest event of the same type
if a particular type of event reaches threshold.
Resolves openbmc/openbmc#2254
Change-Id: I2692193a027e82032f1d336515691de913bbb726
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Implement the logging event interface.
Create the dbus event object based on the event type.
Change-Id: Idfa9e5c43f170d904fd25f22d73e0509b1785fc9
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
On handling of property change event, If callback is
of type event then event manager would be asked to create
the event dbus objects.
Change-Id: I7f1d365d7f44a1cca54516e9ef555bb132d6b063
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When event call back is called,There could be two context
1) As part of actual D-bus signal
2) During startup of dbus-monitor
if event call back is called with context as startup then
don't take any action.
Corrected the index value to fetch the property name.
Change-Id: Ifaae33dc78841c8f771fe3788e75f79d9de6ec12
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the notion of a callback context. This enables callbacks
to have logic around the conditions they were invoked in.
There are two context on which call back can be invoked
1) Startup: during startup all the call backs will be called
2) Signal: As part of condition match on the watched properties.
Callback would behave differently based on the context.
eg: eventCallback
1) Startup: Don't take any action.
2) Signal: Create the Dbus Object for the event.
Change-Id: If455558798ac3e44bbd8a93de0ce1b09d2e308ae
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
we are using the std algo's in this file
but missed to include the c++ algorithm header file.
Change-Id: Ib88f810a048dba18526b7c7cf42d87ba095a27be
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GetBus function provides the same instance of the
bus application in the process.
Now there is a need where we need the same bus instance
at multiple places.
Remove the friend loop, now it is not needed as we have
changed the scope of getBus.
Change-Id: I7e8cda45f3835b1d93be36f317741bc4ae6951a2
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
eg:-
- name: example event callback
description: >
'Callbacks are actions PDM should take when instructed to do so.
Some callback types refer to a group of paths and group of properties
in a similar fashion as the property watch directive.
The event callback creates the event D-Bus object with the given name
and the event message.
eg /xyz/openbmc_project/events/test/<id>'
class: callback
callback: event
paths: example path group
properties: example property group
eventName: test
eventMessage: "Test configuration changed."
When fully implemented, event callbacks will create DBus objects for
preconfigured DBus events.
Change-Id: I73d46a9bc630763cc1a74877803a638f3a8d1e1f
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Add parser support for template rendering of events.
Also defines the EventBase and Event classes.
EventBase is parent of Event.
Change-Id: I6b07b415acf510a8437529095bd489c0af73ddf5
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I16cbfa2a3ed646f3ca0aeee0e71b3ada39062941
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
| |
Change-Id: I9f21e6378f74bf9dd7d413557a80b47ec9c9f829
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
| |
Change-Id: Ie80bff38947a79cc686eaf9db9c80453d28a4fb6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
| |
The callout to resolve is specified in the YAML.
Change-Id: If613fae1959c6a54279b2a50c7d858f3e7d831b9
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Fill in the function that sets the Resolved property
on an error log entry.
Change-Id: I78b57c413a7047508b7fc95e0cf27e1ae6e871cf
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
In order to find the error logs that have a specific callout,
the code needs to look in the 'endpoints' property of the
'<callout>/fault' D-Bus object.
Change-Id: Idb9c06a6d815195ed47fb6ec914ba8f89539cb85
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Add a function to SDBusPlus to get the D-Bus bus
name for an object path and interface.
Change-Id: I7d7a533c7430fcf42e1e0f6a21a2453e6c8197ea
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This class is a type of callback, and when triggered will
resolve all error log entries that have the specified callout.
It does this by setting the Resolved property on the log entry.
It can be used to do things like resolve all errors against a
particular part when that part is replaced, which would be done
by specifying this class as a callback on a watch on the Present
property for the part in the inventory.
Change-Id: I50557938c9e15a91744ee2a16d67eaa7f367ef04
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Spelling errors found using github.com/lucasdemarchi/codespell
A tool to fix common misspellings.
This tool is licensed under GNU General Public License, version 2.
Change-Id: I83c844373ea41d762367085cb16b01d31676e33d
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
| |
Add tests to callbackgroupgentest/test.yaml
Change-Id: I0b9d4799dd3ed3a4876115594aacbd80caa3f9d0
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
| |
Change-Id: I97f73dd310cae4b2d67122bc51414e2a5397f0b3
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
| |
Change-Id: I58a6ac714cfa80462ab53d4487dc727e40038b06
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Added support for metadata in elog.hpp, elog mako file, and pdmgen.
This metadata will be added with the error log.
Change-Id: Iaf0fe24d71f6bdd02b51df208b2c1d66c68319d3
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Added support for "callback: elog" in PDM.
templates/elog.mako.cpp is used to generate the Elog call.
templates/errors.mako.hpp is used to generate the errors.hpp
used by generated.hpp to include any error.hpp files like
"xyz/openbmc_project/Common/error.hpp"
Change-Id: Id0ae3aca4282095f58a8939b70e398bec706d7f5
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Created new Elog callback, which will create an error log.
This is just the base, more to come.
Change-Id: I50c12c8bff0942b5cb027e38d0cc8691e8a241b4
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
| |
Change-Id: Ia9ae40f1bd590945e2fee662e4437b92c8bd9b09
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
| |
Remove a number of unused files.
Change-Id: If7e40d2be7eb3f5d84538a3c86f911df268a1f34
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
| |
Prefer implicit conversion for readability.
Change-Id: I64d04b926edea0531a5414a416c04b36ae3d5e2a
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
| |
Switch from sd_bus process to sd_event run so that sd event
handlers are invoked.
Change-Id: If7c1f046f30cc845c6e9fcc72eb99c5bdfb36052
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow watch class users to explicitly invoke the watch
callback.
Since watches and callbacks share a common pool of state
all watches must complete their initialization prior to
invoking their callback methods.
Change-Id: I62ebad64da88a145f3d5006b07c01381b0eb6728
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
| |
Add a simple test that invokes all the callbacks. There
are no assertions but there is some value in ensuring
the application will at least run without crashing.
Change-Id: I117bff261202ae7e642094a659a954328351eac1
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
| |
Fix a number of bugs related to rendering and instantiation of
string and bool templates.
Change-Id: Ic75842b4016f4d96bf5850f9c4ad778d82e075ed
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
| |
journald ignores lowercase metadata keys so require them
to be uppercase. Abort the config file parse when lowercase
keys are found.
Change-Id: Icffffdc6680b4d305329c3395f8e2fda6210964f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
| |
Change-Id: Id6e14414c6f15c11d1476039e3781d719f693d21
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Deferrable callbacks delay callback invocation until a
pre configured length of time has elapsed. One example
scenario where deferrable callbacks help is to avoid
oscillation when testing a condition and making callbacks
frequently.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I180c99b57ec1c9bde4da76d947a026f809341c8a
|
|
|
|
|
|
|
|
| |
Add an sd-event interface abstraction to facilitate
mocking and unit test.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5880617565fc6eab54335adc30033d4b132568f8
|
|
|
|
|
|
|
|
|
|
|
| |
Add C++ wrappers around select sd-event APIs, for a more C++ like
programming API.
Includes support for core sd_event and timer related sd_event_source
APIs.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I10ac5406c9f8831b4efb294d3aef36026469d4a5
|
|
|
|
|
| |
Change-Id: Id4157b9f40c80c5bb7d54d10f74ba7ecdeb199e5
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
| |
Add support for a method callback. The method callback enables
arbitrary DBus method calls. A sample use case could be
starting a systemd unit via the sytemd DBus API.
Change-Id: If25131d11497c82f862ae1f47da066c5fd8b2e2e
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add core support for rendering argument lists. Add a number of
decorators like:
-literal: Render a literal value.
-cast: Render a C++ cast.
-fixbool: Work around yaml boolean capitalization.
-quote: Quote a string literal.
Change-Id: I4364d9f7a8cb7bb932d347d34bfabb88e694020a
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
| |
Callbacks must ultimately be triggered when a property
is updated by a watch. Add that support.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I20130a11c19ddcf2c4ae45800f2068b31950bcd6
|
|
|
|
|
| |
Change-Id: I94059c0be78d5b97e7e0e11c78d4a164a98a483e
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
| |
Enable conditional application of callbacks.
Change-Id: I9d765e5f585aac40994b65da3b51ea891beae9bf
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
| |
Change-Id: Icbdc8612d73bed065227d9edfde1426206886652
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
| |
Allow named collections of callbacks to be defined and used anywhere
callbacks are used.
Change-Id: I3224aa06b2250e9a055bc70d20c186caecd033af
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|