mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 21:57:47 +00:00
[uptime] new feature to track OT instance uptime (in msec) (#6968)
This commit adds a new module `Uptime` which tracks the number of milliseconds since OpenThread stack initialization as an `uint64_t` value. It also adds public OT APIs to get the current uptime value (either as the number of milliseconds or in human-readable string format like "2 days 12:45:12.762"). A CLI `uptime` command is also added. This feature can be enabled using the newly added config option `OPENTHREAD_CONFIG_UPTIME_ENABLE` (or the related CMake `OT_UPTIME` option).
This commit is contained in:
committed by
Jonathan Hui
parent
0f73466897
commit
ca3830fac2
@@ -145,6 +145,7 @@ size_nrf52840_version()
|
||||
"-DOT_SRP_SERVER=ON"
|
||||
"-DOT_TIME_SYNC=ON"
|
||||
"-DOT_UDP_FORWARD=ON"
|
||||
"-DOT_UPTIME=ON"
|
||||
)
|
||||
|
||||
local thread_version=$1
|
||||
|
||||
@@ -100,6 +100,7 @@ readonly OT_POSIX_SIM_COMMON_OPTIONS=(
|
||||
"-DOT_LOG_LEVEL_DYNAMIC=ON"
|
||||
"-DOT_COMPILE_WARNING_AS_ERROR=ON"
|
||||
"-DOT_RCP_RESTORATION_MAX_COUNT=2"
|
||||
"-DOT_UPTIME=ON"
|
||||
)
|
||||
|
||||
die()
|
||||
|
||||
@@ -122,6 +122,7 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=(
|
||||
'-DOT_COVERAGE=ON'
|
||||
'-DOT_LOG_LEVEL_DYNAMIC=ON'
|
||||
'-DOT_COMPILE_WARNING_AS_ERROR=ON'
|
||||
'-DOT_UPTIME=ON'
|
||||
)
|
||||
|
||||
readonly OT_CLANG_TIDY_CHECKS="\
|
||||
|
||||
@@ -67,6 +67,7 @@ build_simulation()
|
||||
"-DOT_SERVICE=ON"
|
||||
"-DOT_SRP_CLIENT=ON"
|
||||
"-DOT_SRP_SERVER=ON"
|
||||
"-DOT_UPTIME=ON"
|
||||
"-DOT_THREAD_VERSION=${version}"
|
||||
)
|
||||
|
||||
@@ -275,6 +276,7 @@ do_build_otbr_docker()
|
||||
"-DOT_SLAAC=ON"
|
||||
"-DOT_SRP_CLIENT=ON"
|
||||
"-DOT_TREL=OFF"
|
||||
"-DOT_UPTIME=ON"
|
||||
"-DOTBR_DUA_ROUTING=ON"
|
||||
"-DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_DNSSD_SERVER_BIND_UNSPECIFIED_NETIF=1'"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user