summaryrefslogtreecommitdiffstats
path: root/core_manager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable clang code formatJayanth Othayoth2018-10-181-20/+14
| | | | | | Change-Id: Ib640ef7cea99ff505965182ec9900a2d53a8986e Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add error handling for message parsingWilliam A. Kennington III2018-05-291-1/+12
| | | | | | | | | | Some of the signals we try and parse for error logs are not structured in the format we expect when parsing. When error logging is enabled in sdbusplus this causes the phosphor-dump-manager to crash. Fix this crashing by logging errors and ignoring the bad signals. Change-Id: Ieadcb7e95f622005382f3c4957bf1535e3bb1ef9 Signed-off-by: William A. Kennington III <wak@google.com>
* Fix for missing core file in the ApplicationCored type BMC dumpJayanth Othayoth2017-10-121-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During application core, Systemd-coredump creates a temporary core file first, compresses the file and renames it to systemd-coredump name format. dreport relies on inotify notifications to initiate the core dump collection. Usually inotify generates IN_MOVED_TO events followed by IN_CLOSE_WRITE event on creation of system-coredump file. In UBI filesystem, inotify notification events behave differently as summarized below: -------------------------------------------------------------------- Inotifiy Event : UBI FS : COW -------------------------------------------------------------------- - IN_MOVED_TO : _NA_ : notification event : : structure provides the : : name of the core file. : : - IN_CREATE : notification event : _NA_ : structure provides : : the name of the core : : file. : : : - IN_CLOSE_NOWRITE : notification triggers: _NA_ : directory level and : : size of name field : : shows zero. : : : : : - IN_CLOSE_WRITE : notification event : notification event : structure provides : structure provides the : the INODE number : name of the core file. : instead of name of : : the core file. : ---------------------------------------------------------------------- Current implementation relies on inotify IN_CLOSE_WRITE event with the name of the core file to trigger the dump collection. However, in UBI FS, the inode number is sent in the inotify instead of the name of the core file. Hence the copying of the core file during the dump collection process fails due to lack of the file name information. While IN_CLOSE_WRITE is the appropriate event, IN_CREATE is the closest match for UBI FS. Hence the *workaround* published by this patch watches for IN_CREATE event for the UBI FS based systems. One possible side effect is premature handling of large systemd-core file resulting in an incomplete file. However, this was _not_ observed during testing due to the time interval between the inotify and dreport consuming the file. A more generic fix may be explored for issue #2287. Resolves openbmc/openbmc#2240 Change-Id: Id88181c62a34c05646eed4ac7e67d9b37a523733 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Refactor core dump handling functions into core manager classJayanth Othayoth2017-09-121-5/+2
| | | | | Change-Id: I700ecf517f26332c0a5e0de87c77cffd94f6bb9a Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Add core file name validation in core managerJayanth Othayoth2017-09-011-4/+26
| | | | | | | | | | Move the core file name validation from dreport to core manager. systemd-coredump creates temporary file in core file path prior to actual core file creation. This check will help to limit dump creation only for the new core files. Change-Id: I196d3f372d85aae0a7a36ba7171e6bfd2ff4991b Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Add support to enable dump collection for core dumpJayanth Othayoth2017-07-271-4/+55
| | | | | | | Implemented d-bus internal create function. Change-Id: I34088d4c084a5a086189f4bc9e84e53a39193501 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Update core file monitor infrastructre using common inotifyJayanth Othayoth2017-07-181-0/+30
Resolves openbmc/openbmc#1510 Change-Id: I5f73c4330df8a5deab29e29201e8521740e6b047 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
OpenPOWER on IntegriCloud