| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The opened file descriptor and inotify won't be released, if the synced
file generate in time. This happens occasionally, but the leakage will
lead to journal log failure and will not able to use inotify after a
long period run.
Change-Id: I09cca72c88091ebcf1bb7ddb7df04ee1d2b2d7d6
Signed-off-by: Troy Lee <troy.lee@vertiv.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each error log commit forces a journal sync and needs to wait for the
sync to occur before allowing the commit to continue. The loop managing
the journal sync was only performing 2 iterations where the first
requests the sync and the second configures the inotify watch. However,
the polling necessary to wait for the inotify would never occur. This
bumps the managing loop to 3 iterations to allow the polling to occur on
the 3rd iteration.
Tested:
The 5sec polling section of code is run on the 3rd iteration
Change-Id: If12c5b33849843b33bb252efd1eb88e0bc954d6d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the xyz.openbmc_project.Logging.Create interface on the
/xyz/openbmc_project/logging path. The interface provides a single
method, Create, that allows one to create an event log.
This is an alternative to using the report/commit functions provided by
the phosphor-logging/elog.hpp header file.
Unlike those report/commit interfaces, this does not require that the
entries in the AdditionalData event log property be defined ahead of
time, as the whole AdditionalData contents are just passed in instead of
read out of the journal. This means that the error does not need to
have been defined in the error and metadata YAML files for an event log
to be successfully created. The discussion on if that is still desired
anyway is outside the scope of this commit.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Icf3f740ab86605deeaeb955ff51aa2ef292f5af4
|
|
|
|
|
|
|
|
|
| |
In preparation for adding another function to create a log entry, factor
out some common code into a new function that will be able to be called
in both spots.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I8881f4ec0d36a2b2e2b1897b63d524022a328286
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal of extensions is to extend phosphor-logging's
`xyz.openbmc_project.Logging.Entry` log support to allow other log
formats to be created without incurring extra D-Bus call overhead.
The README.md change in this commit provides additional documentation on
how extensions work. The summary is that they allow code that resides
in this repository to provide functions that can be called at certain
points (startup, log creation/deletion) such that the code can then
create their own logs based on the contents of an OpenBMC log. A
specific extension's code is compiled in using a --enable configure
option, so platforms that did not use those log formats would incur no
performance/size penalties.
This commit provides the support for extensions, plus a basic OpenPower
PEL (Platform Event Log) extension as the first extension. PELs are
event logs used only on some OpenPower systems.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ifbb31325261c157678c29bbebc7f6d32d282582f
|
|
|
|
|
|
|
| |
Added std namespace to places where there is a cpp version.
Change-Id: I60a05a7c9cdcd79cfffc3c4968005fcbe34acf81
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many functions have a variable entry in a sub namespace to the outer
symbol entry from phosphor-logging/log.hpp
[phosphor-logging/log.hpp:73] -> [log_manager.hpp:104]: (style) Local
variable entry shadows outer symbol
[phosphor-logging/log.hpp:73] -> [log_manager.cpp:226]: (style) Local
variable entry shadows outer symbol
[phosphor-logging/log.hpp:73] -> [log_manager.cpp:243]: (style) Local
variable entry shadows outer symbol
[phosphor-logging/log.hpp:73] -> [elog_meta.hpp:37]: (style) Local
variable entry shadows outer symbol
Change-Id: Icf5d585ec05b0a545e515d0afb7d2267645a2f2c
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
| |
Change-Id: I2c36b7886a25d0b235693b0776019d29608e1d52
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The journald synced file is created during a journal sync, so
if it's missing, the log manager should still perform the sync
operation so that the synced file gets created. This is the
behavior of journalctl which this function is copying, just
this logic wasn't transferred in the original commit. Reference:
https://github.com/systemd/systemd/blob/60118b21c6b4b29376615921c5edc1b05cde306f/src/journal/journalctl.c#L1999
Disabled the unit test cases that call commit since they now
fail. Opened issue openbmc/phosphor-logging#11 for debug.
Closes openbmc/phosphor-logging#10
Tested: With the synced file missing, verified that a commit
operation created the file and there were no error messages
about failing to open the synced file.
Change-Id: Ia720741b99552d51d13cdc6b4e08dbbab58bca77
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The application implements the xyz.openbmc_project.Network.Client D-Bus
interface to set a remote rsyslog server's address and port in the
rsyslog config file.
This lets us configure rsyslog to be able to stream out logs.
TODO: Exception handling and validation will be handled in subsequent
commits.
Change-Id: I8917daab3f0de1806d2f1aafe99cb3a872f19184
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
| |
-Add unit tests for error wrapping
Change-Id: Ib15620d84de8ab5abdc85b8f88dd7c05f83fd6f3
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
The previous logic only called close if the file had been opened AND
there was a valid inotify watch handle. Even if there is not a watch
handle, the file should be closed.
Change-Id: Id1f6d441129e13c6a48d6156161425082aeba8e8
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the xyz.openbmc_project.Software.Version interface to
the elog entries. This allows a user to know what BMC code
level was running when the error was created. The level is
persisted along with the other elog fields.
If this code is flashed on a system that was running older code,
and there were existing error logs, the version property will
be left empty in the restored log entries.
Older code is still able to restore logs created by this code
as the version property is at the end of the serialized data
and so is just ignored by Cereal.
Resolves openbmc/openbmc#3133
Tested: Check that new error logs have the code level, and that
restarting phosphor-log-manager preserves that property
on the existing logs. Various incantations of running
the older code with logs created by this code, and running
this code with logs created by older code.
Change-Id: I682aa3bf97c8352ce6dda05dfdf55d33173de891
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Read the BMC code version once at startup. This will
be added to error logs in future commits.
The code is getting the version from a file instead
of from D-Bus in order to reduce dependencies.
Tested: Call the function and check that it returned the
correct thing.
Change-Id: I9a4729e946a130ec32c375c283fd22a7658121f5
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Synchronize D-Bus method was a systemd patch that calls "journalctl --sync"
and will not be upstreamed to systemd. Instead duplicate the function locally
in the log_manager so that the patch can be dropped, since the systemd journal
service would not start on time if it was idle, leading to missing metadata.
Closes openbmc/openbmc#2257
Tested: While printing continously into the journal, verify that a commit
request is blocked until the journal is flushed.
Change-Id: I8248c4c2e2eaeb041f7876832b395b053409acdd
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Errors reported by the phosphor-logging app have a default error level,
and this level is specified in the error's YAML definition.
Enable users of the error's report() API to specify an error level. A
user may perceive a different error level for an error scenario, for eg
there may be certain host errors (for which we set the level as 'Error')
that may just be 'Warnings'.
Change-Id: I666a0ddcb099e530c423358a3b1c65f33b0ad01e
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes openbmc/openbmc#2687
-cap on error exists to deal with small flashes, right now the cap
is 100 for high severity errors and it is 10 for info(and below)
severity) errors.
-previous policy was to stop logging new errors once cap is reached
for high severity errors.
-based on feedback from field engineers, it's better to log new
errors, external tools will typically periodically read and store
errors, so we won't lose them.so the new policy now is to roll errors.
Change-Id: I18b509d81c076fcb80667300cbfda050027bb422
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Check if the data in the persisted files is valid before
restoring the error entries
Resolves openbmc/openbmc#2646
Change-Id: Iff0846a3366a27e59484113b7020f540087aa994
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I21e0cd5a03ee06db17b8d3ed7b712b3d350b6a5f
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Added new Cap for info(and below) severity errors, if cap size reaches,
next commited error of severity:info(and below) will replace the first
entry of severity:info(and below).
Resolves openbmc/openbmc#2381
Change-Id: I2e56c28a934bf3139e57b36d252bd5ad3e1dd90f
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Cereal class versioning helps to handle data de-serialization
across different class versions that differ in the way, a
particular data is serialized.
Change-Id: Ica01c4cb0c213e0dca8824fcfcfaa5cb43c5bc2e
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Resolves openbmc/openbmc#1561.
Change-Id: Iac5aaee1bdf9b87ccce9bf8801468ac5a8f9be6c
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
| |
dreport need PID information to collect process specific journal
for InternalFailure type error triggered dump.
Change-Id: I313caa4795f7c0d47c1f42dae0653008cdbd5967
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
|
|
|
|
|
|
|
| |
Resolves openbmc/openbmc#1617
Change-Id: I5850e5addb723e6f5102eb4677bb365285c1a633
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Call the Synchronize method at the beginning of the Commit
function to request that all pending messages are written into
the journal.
Fixes: openbmc/openbmc#1297
Change-Id: Id0ab04ff0cb9b7eeac3b7c2aaeb8730a3b4ed524
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
| |
Resolves openbmc/phosphor-logging#4
Change-Id: I15ccdef0dd63216991bbd113e47beb057df14df8
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
At present org.open_power.Error.Host.Event.Event is handcoded
and is not part of the error map used by log manager to identify
the type of the error.
Resolves openbmc/openbmc#1953
Change-Id: I2f390c29c9b47adcf20efc32bbb02cf026d55758
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
| |
Change-Id: If2418ad9350d7f3bdbfe28a00728f431f08baf9f
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use Cereal to implement serialization and de-serialization of
properties of error d-bus objects.
Serialize and persist error d-bus objects as they are put on the bus.
De-serialize and restore them (if persistent ones exist) when
phosphor-log-manager starts up.
Change-Id: I1f5df1abbe74bfdb86e3e82a78ff7115e90e2112
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Have the entry object store a reference to the error manager, passed via
the entry ctor.
Change-Id: I2c4a8c4c95929ab7005620f44ac17e9654d8e906
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
| |
The erase method can erase an entry object specified by id.
Change-Id: I86bb2a214b8cf9b951af37f69767ff025f2f5fd0
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set generated maps to be const so that they don't get
accidentally overwritten.
Use .find() to access these generated data sets as the [] operator
is not const.
Declare the generated maps as extern so that there's
no need to include the generated .cpp file.
Change-Id: I4efdcace099bec738e1fa9b67decbedd515d3dfa
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Check if error metadata fields have associated handlers, if yes, invoke
them before construction the error d-bus object.
Change-Id: I197385c5c43242f633274b82289cd70c85c1d6e7
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Pass a list of associations to the Entry ctor. This enables to create
associations between the error object and other objects, if such
associations exist.
Change-Id: I88a517efc0ead0a62b2e6558822d94b8fc1c6070
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
journald does not guarantee that sd_journal_get() returns NULL terminated
strings. Specify the actual length of the string (instead of relying on
functions that look for NULL terminators to determine the length) to
compare the transaction id number, otherwise intermittent errors can occur.
Change-Id: I58c34f377866f002a09b07810065b4e064f216b9
Closes: openbmc/openbmc#1217
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Currently the code would search for a matching string in the whole
TRANSACTION_ID=1234 string, but there may cases that this could
result in a false match.
Change to extract the id number out of the string to do an exact compare.
Change-Id: I2cc0e6b42937a36e9afb942c07c91c0b4469a963
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Change the logic of the commit function from searching
the journal for each metadata variable, to looking
for all metadata variables in each journal entry.
This change reduces the number of times that we search
through the journal from N to 1 time.
Change-Id: I47143e746dafb06bdce25dfd0009933494f4d25d
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Fix the TODO to search for all the metadata variables in
the journal.
Change-Id: I62e01e5923b3d29317ef94b5b340153bbb8967a7
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the code that writes data to a tmp file. The error log
entry will be saved via dbus property caching openbmc/openbmc#1055
Remove the code that gets the MESSAGE field from the journal,
the error log entry doesn't have a use for it as it uses the
exception name.
Change-Id: Ie400acadc4a34f0d558808af47b41795f0ce8e2c
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Now these files are copied to a folder under phosphor-logging,
other repositories will need to be fixed. I'm leaving the files in
the base dir as well until I work on fixing all projects that
utilizes log.hpp and elog.hpp
Change-Id: Ie4640852727c1572325e974548737bc70a6db7c2
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Temporary support for the HostEvent data that is checked in
instead of auto-generated.
Change-Id: I34e0c8d91dd51b26efaadbe0cd8be951f0e4bc01
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Populate the Entry Timestamp property which is
described as the time when the error log entry
is committed in milliseconds since 1970.
Change-Id: Id47fb974cf8220975eef0cc226581d0603a798a9
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Create an Entry dbus object when Commit is called and fill in
its properties with the journal data.
Change-Id: I155cacbdfdccfa8b1f594503d858710fa71f2026
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
| |
The design direction changed after the commit that added the
log_manager main function, so updating it to the correct usage.
Change-Id: I88459fb65ba6b8272f0f9f85b55f9f837487ffea
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Add the lookup mako target to the makefile to get it built.
Use the lookup map to find the metadata that needs to be
added to the error log. Use the transaction id to filter
for the desired journal entries.
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Change-Id: Ia57dc83aab4f7ee35f8de32a799c862be28113f7
|
|
|
|
|
| |
Change-Id: Id2ad6a75b6ee3f7226c7cfd274dba24de89f9363
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Create error/event log based on message id (process id)
and metadata values.
Change-Id: Iaf944130c4075ae2d2c192e5ef840451561791bc
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
Error/event log dbus object with a placeholder method.
Change-Id: Icfa3f0dcddb3f47a62d8480a936bd8baa4b49760
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|