Skip to content

Commit

Permalink
Merge pull request OpenDDS#4677 from mitza-oci/threadstatusmanager-ti…
Browse files Browse the repository at this point in the history
…ming

Updates to the InternalThreadStatus built-in topic and boottime timer support
  • Loading branch information
jrw972 authored Jun 7, 2024
2 parents 1840a59 + a7c8efd commit 607413e
Show file tree
Hide file tree
Showing 38 changed files with 431 additions and 339 deletions.
38 changes: 16 additions & 22 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2636,14 +2636,11 @@ jobs:
cat "$GITHUB_WORKSPACE/OpenDDS/${{ github.job }}_autobuild_workspace/logs/latest.txt"
grep -q 'Failures: 0' "$GITHUB_WORKSPACE/OpenDDS/${{ github.job }}_autobuild_workspace/logs/latest.txt"
ACE_TAO_u22_gcc11_i0_xer0:
ACE_TAO_u22_i0_xer0:

runs-on: ubuntu-22.04

steps:
- name: install gcc and g++
run: |
sudo apt-get install g++-11
- name: checkout OpenDDS
uses: actions/checkout@v4
with:
Expand All @@ -2664,7 +2661,7 @@ jobs:
- name: get compiler version
shell: bash
run: |
export COMPILER_VERSION=$(g++-11 --version 2>&1 | head -n 1)
export COMPILER_VERSION=$(g++ --version 2>&1 | head -n 1)
echo "COMPILER_VERSION=$COMPILER_VERSION" >> $GITHUB_ENV
- name: Cache Artifact
id: cache-artifact
Expand All @@ -2682,7 +2679,7 @@ jobs:
if: steps.cache-artifact.outputs.cache-hit != 'true'
run: |
cd OpenDDS
./configure --compiler=g++-11 --std=c++20 --no-inline --tests --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING
./configure --std=c++20 --no-inline --tests --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING
- name: build ACE and TAO
if: steps.cache-artifact.outputs.cache-hit != 'true'
run: |
Expand All @@ -2708,16 +2705,13 @@ jobs:
name: ${{ github.job }}_artifact
path: ${{ github.job }}.tar.xz

build_u22_gcc11_i0_xer0:
build_u22_i0_xer0:

runs-on: ubuntu-22.04

needs: ACE_TAO_u22_gcc11_i0_xer0
needs: ACE_TAO_u22_i0_xer0

steps:
- name: install gcc and g++
run: |
sudo apt-get install g++-11
- name: checkout MPC
uses: actions/checkout@v4
with:
Expand All @@ -2732,13 +2726,13 @@ jobs:
- name: download ACE_TAO artifact
uses: actions/download-artifact@v4
with:
name: ACE_TAO_u22_gcc11_i0_xer0_artifact
name: ACE_TAO_u22_i0_xer0_artifact
path: ACE_TAO
- name: extract ACE_TAO artifact
shell: bash
run: |
cd ACE_TAO
tar xvfJ ACE_TAO_u22_gcc11_i0_xer0.tar.xz
tar xvfJ ACE_TAO_u22_i0_xer0.tar.xz
- name: checkout OpenDDS
uses: actions/checkout@v4
with:
Expand All @@ -2747,7 +2741,7 @@ jobs:
- name: configure OpenDDS
run: |
cd OpenDDS
./configure --compiler=g++-11 --std=c++20 --no-inline --tests --rapidjson --boottime --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING
./configure --std=c++20 --no-inline --tests --rapidjson --boottime --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING
- name: check build configuration
shell: bash
run: |
Expand All @@ -2766,7 +2760,7 @@ jobs:
source OpenDDS/setenv.sh
mkdir OpenDDS/tests/cmake/build
cd OpenDDS/tests/cmake/build
cmake -DCMAKE_CXX_COMPILER=g++-11 ..
cmake ..
cmake --build . -- -j4
- name: create OpenDDS tar.xz artifact
shell: bash
Expand All @@ -2783,11 +2777,11 @@ jobs:
name: ${{ github.job }}_artifact
path: ${{ github.job }}.tar.xz

cmake_u22_gcc11_i0_xer0:
test_u22_i0_xer0:

runs-on: ubuntu-22.04

needs: build_u22_gcc11_i0_xer0
needs: build_u22_i0_xer0

permissions:
contents: read
Expand All @@ -2813,13 +2807,13 @@ jobs:
- name: download ACE_TAO artifact
uses: actions/download-artifact@v4
with:
name: ACE_TAO_u22_gcc11_i0_xer0_artifact
name: ACE_TAO_u22_i0_xer0_artifact
path: ACE_TAO
- name: extract ACE_TAO artifact
shell: bash
run: |
cd ACE_TAO
tar xvfJ ACE_TAO_u22_gcc11_i0_xer0.tar.xz
tar xvfJ ACE_TAO_u22_i0_xer0.tar.xz
- name: checkout OpenDDS
uses: actions/checkout@v4
with:
Expand All @@ -2828,13 +2822,13 @@ jobs:
- name: download OpenDDS artifact
uses: actions/download-artifact@v4
with:
name: build_u22_gcc11_i0_xer0_artifact
name: build_u22_i0_xer0_artifact
path: OpenDDS
- name: extract OpenDDS artifact
shell: bash
run: |
cd OpenDDS
tar xvfJ build_u22_gcc11_i0_xer0.tar.xz
tar xvfJ build_u22_i0_xer0.tar.xz
- name: check build configuration
shell: bash
run: |
Expand Down Expand Up @@ -2881,7 +2875,7 @@ jobs:
<command name="check_compiler" options="gcc"/>
<command name="print_perl_version"/>
<command name="print_autobuild_config"/>
<command name="auto_run_tests" options="script_path=tests dir=$GITHUB_WORKSPACE/OpenDDS --no-dcps --cmake"/>
<command name="auto_run_tests" options="script_path=tests dir=$GITHUB_WORKSPACE/OpenDDS -Config CXX11 -Config RAPIDJSON -Config BOOTTIME_TIMERS"/>
<command name="log" options="off"/>
<command name="process_logs" options="move prettify index"/>
</autobuild>
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ my %platforminfo =
'cl_versions' => {13.1 => 'vc71', 14 => 'vc8', 15 => 'vc9',
16 => 'vc10', 17 => 'vc11', 18 => 'vc12',
19 => 'vc14', 19.1 => 'vs2017',
19.2 => 'vs2019', 19.3 => 'vs2022'},
19.2 => 'vs2019', 19.3 => 'vs2022', 19.4 => 'vs2022'},
'cl_archs' => {'x64' => 1, 'Win32' => 1, 'ARM64' => 0, 'ARM' => 0}, # 1 if supported
},
'macos' => {
Expand Down
4 changes: 2 additions & 2 deletions dds/DCPS/DataReaderImpl_T.h
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ namespace OpenDDS {
bool filtered = false;
SubscriptionInstance_rch instance;

const DDS::Time_t now = timestamp.to_dds_time();
const DDS::Time_t now = timestamp.to_idl_struct();
DataSampleHeader header;
header.source_timestamp_sec_ = now.sec;
header.source_timestamp_nanosec_ = now.nanosec;
Expand Down Expand Up @@ -898,7 +898,7 @@ namespace OpenDDS {

SubscriptionInstance_rch si = get_handle_instance(instance);
if (si && state != DDS::ALIVE_INSTANCE_STATE) {
const DDS::Time_t now = timestamp.to_dds_time();
const DDS::Time_t now = timestamp.to_idl_struct();
DataSampleHeader header;
header.publication_id_ = publication_id;
header.source_timestamp_sec_ = now.sec;
Expand Down
12 changes: 6 additions & 6 deletions dds/DCPS/DataWriterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ DataWriterImpl::association_complete_i(const GUID_t& remote_id)
Message_Block_Ptr end_historic_samples(
create_control_message(
END_HISTORIC_SAMPLES, header, move(data),
SystemTimePoint::now().to_dds_time()));
SystemTimePoint::now().to_idl_struct()));

this->controlTracker.message_sent();
guard.release();
Expand Down Expand Up @@ -776,7 +776,7 @@ void DataWriterImpl::replay_durable_data_for(const GUID_t& remote_id)

DataSampleHeader header;
Message_Block_Ptr end_historic_samples(create_control_message(END_HISTORIC_SAMPLES, header, move(data),
SystemTimePoint::now().to_dds_time()));
SystemTimePoint::now().to_idl_struct()));

this->controlTracker.message_sent();
guard.release();
Expand Down Expand Up @@ -1075,7 +1075,7 @@ DataWriterImpl::send_request_ack()
REQUEST_ACK,
element->get_header(),
move(blk),
SystemTimePoint::now().to_dds_time()));
SystemTimePoint::now().to_idl_struct()));

element->set_sample(move(sample));

Expand Down Expand Up @@ -2426,7 +2426,7 @@ DataWriterImpl::end_coherent_changes(const GroupCoherentSamples& group_samples)
Message_Block_Ptr control(
create_control_message(
END_COHERENT_CHANGES, header, move(data),
SystemTimePoint::now().to_dds_time()));
SystemTimePoint::now().to_idl_struct()));

this->coherent_ = false;
this->coherent_samples_ = 0;
Expand Down Expand Up @@ -2550,7 +2550,7 @@ DataWriterImpl::send_liveliness(const MonotonicTimePoint& now)
Message_Block_Ptr liveliness_msg(
create_control_message(
DATAWRITER_LIVELINESS, header, move(empty),
SystemTimePoint::now().to_dds_time()));
SystemTimePoint::now().to_idl_struct()));

if (this->send_control(header, move(liveliness_msg)) == SEND_CONTROL_ERROR) {
ACE_ERROR_RETURN((LM_ERROR,
Expand Down Expand Up @@ -2582,7 +2582,7 @@ DataWriterImpl::prepare_to_delete()
#endif

// Unregister all registered instances prior to deletion.
unregister_instances(SystemTimePoint::now().to_dds_time());
unregister_instances(SystemTimePoint::now().to_idl_struct());

const Observer_rch observer = get_observer(Observer::e_DELETED);
if (observer) {
Expand Down
8 changes: 4 additions & 4 deletions dds/DCPS/DataWriterImpl_T.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ DataWriterImpl_T

DDS::InstanceHandle_t register_instance(const MessageType& instance)
{
return register_instance_w_timestamp(instance, SystemTimePoint::now().to_dds_time());
return register_instance_w_timestamp(instance, SystemTimePoint::now().to_idl_struct());
}

DDS::InstanceHandle_t register_instance_w_timestamp(
Expand All @@ -64,7 +64,7 @@ DataWriterImpl_T

DDS::ReturnCode_t unregister_instance(const MessageType& instance, DDS::InstanceHandle_t handle)
{
return unregister_instance_w_timestamp(instance, handle, SystemTimePoint::now().to_dds_time());
return unregister_instance_w_timestamp(instance, handle, SystemTimePoint::now().to_idl_struct());
}

DDS::ReturnCode_t unregister_instance_w_timestamp(
Expand All @@ -81,7 +81,7 @@ DataWriterImpl_T
// This lack of safety helps performance.
DDS::ReturnCode_t write(const MessageType& instance_data, DDS::InstanceHandle_t handle)
{
return write_w_timestamp(instance_data, handle, SystemTimePoint::now().to_dds_time());
return write_w_timestamp(instance_data, handle, SystemTimePoint::now().to_idl_struct());
}

//WARNING: If the handle is non-nil and the instance is not registered
Expand All @@ -98,7 +98,7 @@ DataWriterImpl_T

DDS::ReturnCode_t dispose(const MessageType& instance_data, DDS::InstanceHandle_t instance_handle)
{
return dispose_w_timestamp(instance_data, instance_handle, SystemTimePoint::now().to_dds_time());
return dispose_w_timestamp(instance_data, instance_handle, SystemTimePoint::now().to_idl_struct());
}

DDS::ReturnCode_t dispose_w_timestamp(
Expand Down
2 changes: 1 addition & 1 deletion dds/DCPS/DomainParticipantImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ DomainParticipantImpl::get_default_topic_qos(
DDS::ReturnCode_t
DomainParticipantImpl::get_current_time(DDS::Time_t& current_time)
{
current_time = SystemTimePoint::now().to_dds_time();
current_time = SystemTimePoint::now().to_idl_struct();
return DDS::RETCODE_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion dds/DCPS/Hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size)
}

memcpy(&ctx->buffer[used], data, free);
data = (unsigned char *)data + free;
data = (const unsigned char *)data + free;
size -= free;
body(ctx, ctx->buffer, 64);
}
Expand Down
8 changes: 4 additions & 4 deletions dds/DCPS/InternalDataReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class InternalDataReader : public InternalEntity {
{
if (instance_state_ == DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE &&
!is_infinite(qos.reader_data_lifecycle.autopurge_disposed_samples_delay) &&
SystemTimePoint::now().to_dds_time() > disposed_expiration_date_) {
SystemTimePoint::now().to_idl_struct() > disposed_expiration_date_) {
not_read_samples_.clear();
read_samples_.clear();
}
Expand All @@ -357,7 +357,7 @@ class InternalDataReader : public InternalEntity {

if (instance_state_ == DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE &&
!is_infinite(qos.reader_data_lifecycle.autopurge_nowriter_samples_delay) &&
SystemTimePoint::now().to_dds_time() > no_writers_expiration_date_) {
SystemTimePoint::now().to_idl_struct() > no_writers_expiration_date_) {
return true;
}

Expand Down Expand Up @@ -511,7 +511,7 @@ class InternalDataReader : public InternalEntity {

if (instance_state_ == DDS::ALIVE_INSTANCE_STATE) {
instance_state_ = DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE;
disposed_expiration_date_ = SystemTimePoint::now().to_dds_time() + qos.reader_data_lifecycle.autopurge_disposed_samples_delay;
disposed_expiration_date_ = SystemTimePoint::now().to_idl_struct() + qos.reader_data_lifecycle.autopurge_disposed_samples_delay;
informed_of_not_alive_ = false;
return true;
}
Expand All @@ -526,7 +526,7 @@ class InternalDataReader : public InternalEntity {

if (publication_set_.empty() && instance_state_ == DDS::ALIVE_INSTANCE_STATE) {
instance_state_ = DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE;
no_writers_expiration_date_ = SystemTimePoint::now().to_dds_time() + qos.reader_data_lifecycle.autopurge_nowriter_samples_delay;
no_writers_expiration_date_ = SystemTimePoint::now().to_idl_struct() + qos.reader_data_lifecycle.autopurge_nowriter_samples_delay;
informed_of_not_alive_ = false;
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion dds/DCPS/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void OpenDDS_Dcps_Export log_progress(const char* activity,
{
ACE_DEBUG((LM_INFO, "(%P|%t) {transport_debug.log_progress} local: %C remote: %C reference: %C time(ms): %Lu activity: %C\n",
DCPS::LogGuid(local).c_str(), DCPS::LogGuid(remote).c_str(), DCPS::LogGuid(reference).c_str(),
duration_to_time_value(MonotonicTimePoint::now().to_monotonic_time() - start_time).msec(),
duration_to_time_value(MonotonicTimePoint::now().to_idl_struct() - start_time).msec(),
activity));
}

Expand Down
Loading

0 comments on commit 607413e

Please sign in to comment.