summaryrefslogtreecommitdiffstats
path: root/test/openpower-pels/Makefile.include
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-12-18 13:48:08 -0600
committerMatt Spinler <spinler@us.ibm.com>2020-02-14 19:15:42 +0000
commitf682b40dcde8badb7029a063e299e1bdf1501444 (patch)
tree00bec044d02c3d5190e84a1a976640dce294678d /test/openpower-pels/Makefile.include
parent7ae2fa69f2bd15cbd22be54aeefbb49d3ad06fc5 (diff)
downloadphosphor-logging-f682b40dcde8badb7029a063e299e1bdf1501444.tar.gz
phosphor-logging-f682b40dcde8badb7029a063e299e1bdf1501444.zip
PEL: Add ability to create event logs
There are cases where the PEL code wants to be able to create OpenBMC event logs (and thus PELs) for problems it encounters when trying to create or import other PELs. For example, if the host were to send down a malformed PEL, this code would like to create a new event log and capture part of that bad PEL in the new PEL for debug purposes, as the malformed PEL cannot be reported anywhere since it is malformed. To handle this, create the EventLogger class that provides a log() function that allows the PEL extension code to create OpenBMC event logs (and thus PELs) from within. The underlying function to do the event log creating is passed in via the constructor so that it can be changed for testing. The sd_event_add_defer function (wrapped by sdeventplus) is used to dispatch the creation of a single event, so that the entry point is from the event loop. If there are still events left on the queue after that, then they will be also be scheduled with sd_event_add_defer so that the events are always created from event loop calls. EventLogger does not allow events to be added to the queue if it is being done from within the creation function so that the code can't get stuck in a loop of creating a new event every time an event is created. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6a9062074dc62cfb6043139ff0a9f3dfcd06c708
Diffstat (limited to 'test/openpower-pels/Makefile.include')
-rw-r--r--test/openpower-pels/Makefile.include9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/openpower-pels/Makefile.include b/test/openpower-pels/Makefile.include
index a700a50..09eb36b 100644
--- a/test/openpower-pels/Makefile.include
+++ b/test/openpower-pels/Makefile.include
@@ -4,6 +4,7 @@ check_PROGRAMS += \
additional_data_test \
ascii_string_test \
bcd_time_test \
+ event_logger_test \
extended_user_header_test \
failing_mtms_test \
fru_identity_test \
@@ -353,3 +354,11 @@ json_utils_test_LDADD = \
$(test_ldadd) \
$(top_builddir)/extensions/openpower-pels/json_utils.o
json_utils_test_LDFLAGS = $(test_ldflags)
+
+event_logger_test_SOURCES = \
+ %reldir%/event_logger_test.cpp
+event_logger_test_CPPFLAGS = $(test_cppflags)
+event_logger_test_CXXFLAGS = $(test_cxxflags) $(SDEVENTPLUS_CFLAGS)
+event_logger_test_LDADD = \
+ $(test_ldadd)
+event_logger_test_LDFLAGS = $(test_ldflags) $(SDEVENTPLUS_LIBS)
OpenPOWER on IntegriCloud