| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For now we will support both the autotools and meson build systems
alongside each other, until support for meson is ready across the
ecosystem.
Tested:
Run through build and unit tests that leverage the new build system
and all of the tests pass and the install puts phosphor-watchdog in
the correct location.
Change-Id: I0454e763acc648ac76efd7728f6da498d9acf5dd
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This improves the runtime of the test suite from 60s down to 6s or less.
Tested:
Run multiple times through the unit test suite without any
flakiness.
Change-Id: Ib7d97ed62b45501db9cf15dba01e33f8f9d07b5d
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow us to change the size of the windows of time we wait for
watchdog events to happen. Right now this doesn't actually change any
behavior it just makes it easier to tweak.
Tested:
Run through the build and unit test suite.
Change-Id: If5b351574346426aff6499701164a3d5ebf9db7c
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc supported this in c++ even though it was non-standard until c++2a is
complete. This change removes designated initializers to make our tests
compliant with std++17.
Tested:
Built and run through unit tests.
Change-Id: I846394c633c0396518db6ed41682bbcf05b890c6
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
Tested:
Ran through build and unit test suite.
Change-Id: I3a906ac26c43ac419eef8a98b20a498fe22f942b
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This simplifies the argument parsing logic drastically and still
provides the same error handling as before.
Tested:
Ran through unit test suite and manually verified that the command
line functions as expected on a real BMC.
Change-Id: Ic5d69adf5359f9f64f2ada17e6a8f3242ca03e25
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This gets rid of the ad-hoc timer class in favor of using the timer
source built into sdeventplus.
Tested:
Unit tests pass and everything still builds. Manually verified the
functionality is still in tact on a zaius machine.
Change-Id: I90619f0fe5a9fdfcecd24a49de672c0c99dc95e9
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a test to ensure that setting the interval on the watchdog affects
subsequent resetTimeRemaining() calls.
Tested:
Ran through a unit test run
Change-Id: Ibff14bbb40d5b93ffd5eaa5149f5cc9822e21d1e
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change refactors the watchdog header to export the type of watchdog
action to systemd target map, so it can be directly used by other files.
This makes enumerating the map type more trivial.
Also convert to an unordered_map instead of map since we don't need the
ordering guarantees.
Tested:
Builds and tests still pass
Change-Id: I77d315210ec27fde295589479c50d46dc5d1b32a
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
| |
Change-Id: I6d9ec8401dcd46781ea258bf8998faa2507fa91d
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
On some machines we want our watchdog running as long as the
phosphor-watchdog daemon is alive. This patch adds an option to enter
fallback mode any time the watchdog expires or is set to be disabled.
Change-Id: Ic96d2f15c761aeb4e25158c5bd861076cca6497d
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes our initial watchdog action is not enough to recover the host
from the state it transitioned into. However, always using a more power
form of power cycle is not desirable as we can lose useful CPU crash
state. It is desirable in this case to have two levels of watchog
timers.
This patch implements the ability for the service to specify a fallback
watchdog action and interval. After the initial watchdog timeout is
encountered, the watchdog will be re-armed with the new parameters. Once
the watchdog times out again it will execute the fallback action.
Attempts to update the timeRemaining will reset the fallback just in
case something is still alive.
Change-Id: I69f4422c7e3963f02200815f3cef620af9e6cf8b
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
This makes no functional changes to the user interface but make future code
reworks shorter.
Change-Id: Ibd57a5d1090588c8a7b2a67730660c3cf47c832e
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
We have lots of unnecessary constructors and forced duration casts.
This change makes all of that logic simpler.
Change-Id: Icfc6d51d75dfb67b3b4c252fbc32beeeded299ca
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
| |
Change-Id: If25a533fd23ede502df402d021742aa19f64d2f6
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
This reduces a bunch of duplicate code that loops through an event loop
to try and guage how long it took for the watchdog to expire.
Change-Id: Ib3b33e250b157df02eff39751277c564ea40705c
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
This helps us refactor some of our existing code and will be useful for
future changes.
Change-Id: Ifa1547f09997d6824f726fc5f46e15eed4c1e8c1
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Googletest derived classes should never have private members unless they
are inteded to not be accessible to class functions. Since class
functions are derived from the provided class, the private members are
unable to be accessed by the test cases. In a future change we need access
to one of these members so make them protected.
Change-Id: Iadbb53adc748d02168a1fc83f738f86437a1d15c
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
| |
This lets us change out the watchdog with a watchdog constructed using
different parameters. Currently this functionality is not used, but it
is needed for a future change.
Change-Id: Ie1e7fbf2c7fc8bf2949237f2535177ecd46944a0
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
| |
This is more in line with normal gtest code style.
Change-Id: If49f700f756ad8d278927baae4e934ef7aa399d7
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
| |
If you specify object files for LDADD it will use some kind of built in
rules for building those objects instead of adding the proper CFLAGS to
the compile process. This results in build failures if the CFLAGS were
actually needed to compile those objects.
Change-Id: I1b7837c41fb5fc840d8b913802cfcdc0ee800455
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
| |
This will be used in future patches. Right now this should retain
similar behavior to the current argument parsing semantics. The
difference is we now require arguments to be specified only once and
error if they are specified multiple times.
Change-Id: I21e4cf9734f045c2b0991f7ed0ec6e6a569eec7d
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
| |
The argument parser had a few subtle bugs and could use some tests.
Change-Id: I0adbc507a822a6887fbf02b888b1f678b3cc7b35
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
| |
Change-Id: I2eb526827987dd2361d35fd782229b1461d49d01
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
| |
Change-Id: I3a85e921f87401701f3ebb22e972e0d3f9cf19c1
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change allows one to set the TimeRemaining as a one-time shot,
and also allows more straightforward control.
-Changing the Interval doesn't reset the watchdog or update the
TimeRemaining.
-Changing the TimeRemaining doesn't set the Interval for future
cycles.
Change-Id: I03a3cdb9cc9e5c4bc034dc86d2b4324a5a4b7243
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A typical watchdog implementation would give these 2 features:
- Setting the interval
- Resetting the timer which also means poke
This watchdog implementation does not provide a poke function
and the same can be achieved by clients making these dbus calls
in that order.
1) Get the Last set Interval
2) Set TimeRemaining field to result from #1
To achieve #1, this commit adds the support.
This would make sure that the new timer would expire after last
updated user interval from that time.
Fixes openbmc/openbmc#767
Change-Id: I7393eb32992d7a08518ef463fd0a442df0772392
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Typically sd_event* calls can not go wrong and if they do, better
would be to terminate the application so we get a coredump.
Change-Id: I899177c369332cabf6d9bc22daaa142b50d758d0
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
Change-Id: Ia0268b6b18999b6dd6cfd26bcadcff25734306f0
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|