Skip to content

Commit

Permalink
apply clang-format
Browse files Browse the repository at this point in the history
Signed-off-by: yamasaki <[email protected]>
  • Loading branch information
ymski committed Sep 11, 2023
1 parent 458a62d commit 17db2b0
Show file tree
Hide file tree
Showing 25 changed files with 114 additions and 167 deletions.
6 changes: 3 additions & 3 deletions CARET_trace/include/caret_trace/context.hpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

#ifndef CARET_TRACE__CONTEXT_HPP_

#include <atomic>
#include <memory>

#include "caret_trace/clock.hpp"
#include "caret_trace/data_container.hpp"
#include "caret_trace/trace_node.hpp"
#include "caret_trace/tracing_controller.hpp"

#include <atomic>
#include <memory>

/// @brief A class for singletons that manage shared instances.
class Context final
{
Expand Down
8 changes: 4 additions & 4 deletions CARET_trace/include/caret_trace/data_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "caret_trace/container_traits.hpp"
#include "caret_trace/data_recorder.hpp"
#include "caret_trace/recordable_data.hpp"

#include <functional>
#include <initializer_list>
#include <memory>
#include <shared_mutex>
#include <string>
#include <vector>

#include "caret_trace/container_traits.hpp"
#include "caret_trace/data_recorder.hpp"
#include "caret_trace/recordable_data.hpp"

#ifndef CARET_TRACE__DATA_CONTAINER_HPP_

/// @brief Interface class for DataContainer.
Expand Down
6 changes: 3 additions & 3 deletions CARET_trace/include/caret_trace/data_recorder.hpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "caret_trace/container_traits.hpp"
#include "caret_trace/recordable_data.hpp"

#include <functional>
#include <initializer_list>
#include <memory>
#include <shared_mutex>
#include <string>
#include <vector>

#include "caret_trace/container_traits.hpp"
#include "caret_trace/recordable_data.hpp"

#ifndef CARET_TRACE__DATA_RECORDER_HPP_

/// @brief Class that manages the recording of all trace data.
Expand Down
4 changes: 2 additions & 2 deletions CARET_trace/include/caret_trace/lttng_session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#ifndef CARET_TRACE__LTTNG_SESSION_HPP_

#include "rclcpp/rclcpp.hpp"

#include <cstdio>
#include <functional>
#include <iostream>
Expand All @@ -25,6 +23,8 @@
#include <type_traits>
#include <unordered_set>

#include "rclcpp/rclcpp.hpp"

/// @brief Interface class for manipulating Lttng sessions.
class LttngSession
{
Expand Down
6 changes: 3 additions & 3 deletions CARET_trace/include/caret_trace/recordable_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

#ifndef CARET_TRACE__RECORDABLE_DATA_HPP_

#include "caret_trace/keys_set.hpp"
#include "caret_trace/singleton.hpp"

#include <cassert>
#include <functional>
#include <iostream>
Expand All @@ -26,6 +23,9 @@
#include <type_traits>
#include <unordered_set>

#include "caret_trace/keys_set.hpp"
#include "caret_trace/singleton.hpp"

/// @brief Interface class for RecordableData.
/// @details New data is stored pending during recording.
class RecordableDataInterface
Expand Down
13 changes: 6 additions & 7 deletions CARET_trace/include/caret_trace/trace_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@

#ifndef CARET_TRACE__TRACE_NODE_HPP_

#include "caret_trace/data_container.hpp"
#include "caret_trace/lttng_session.hpp"
#include "rclcpp/rclcpp.hpp"
#include <memory>
#include <string>
#include <utility>

#include "caret_msgs/msg/end.hpp"
#include "caret_msgs/msg/start.hpp"
#include "caret_msgs/msg/status.hpp"

#include <memory>
#include <string>
#include <utility>
#include "caret_trace/data_container.hpp"
#include "caret_trace/lttng_session.hpp"
#include "rclcpp/rclcpp.hpp"

enum class TRACE_STATUS {
UNINITIALIZED,
Expand Down
10 changes: 2 additions & 8 deletions CARET_trace/src/clock.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@

#include <caret_trace/clock.hpp>

Clock::Clock()
{
lttng_ust_trace_clock_get_read64_cb(&lttng_clock_);
}
Clock::Clock() { lttng_ust_trace_clock_get_read64_cb(&lttng_clock_); }

int64_t Clock::now()
{
return lttng_clock_();
}
int64_t Clock::now() { return lttng_clock_(); }
3 changes: 1 addition & 2 deletions CARET_trace/src/clock_recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.#include <memory>

#include <rclcpp/rclcpp.hpp>

#include <chrono>
#include <iostream>
#include <memory>
#include <rclcpp/rclcpp.hpp>

#define TRACEPOINT_DEFINE
#include "caret_trace/tp.h"
Expand Down
36 changes: 10 additions & 26 deletions CARET_trace/src/context.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@

#include "caret_trace/context.hpp"

#include <chrono>
#include <iostream>
#include <memory>
#include <rclcpp/rclcpp.hpp>

#include "caret_trace/clock.hpp"
#include "caret_trace/data_container.hpp"
#include "caret_trace/lttng_session.hpp"
#include "caret_trace/trace_node.hpp"

#include <rclcpp/rclcpp.hpp>

#include <chrono>
#include <iostream>
#include <memory>

Context::Context()
: Context(std::make_shared<DataContainer>(), std::make_shared<TracingController>())
{
Expand All @@ -47,20 +46,11 @@ TracingController & Context::get_controller()
return *controller_;
}

std::shared_ptr<DataContainer> Context::get_data_container_ptr()
{
return data_container_;
}
std::shared_ptr<DataContainer> Context::get_data_container_ptr() { return data_container_; }

std::shared_ptr<LttngSession> Context::get_lttng_session_ptr()
{
return lttng_;
}
std::shared_ptr<LttngSession> Context::get_lttng_session_ptr() { return lttng_; }

DataContainer & Context::get_data_container()
{
return *data_container_;
}
DataContainer & Context::get_data_container() { return *data_container_; }

TraceNodeInterface & Context::get_node()
{
Expand All @@ -84,12 +74,6 @@ bool Context::is_recording_allowed() const
return false;
}

void Context::assign_node(std::shared_ptr<TraceNodeInterface> node)
{
node_ = node;
}
void Context::assign_node(std::shared_ptr<TraceNodeInterface> node) { node_ = node; }

bool Context::is_node_assigned() const
{
return static_cast<bool>(node_);
}
bool Context::is_node_assigned() const { return static_cast<bool>(node_); }
18 changes: 6 additions & 12 deletions CARET_trace/src/data_container.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

#include "caret_trace/data_container.hpp"

#include "caret_trace/data_recorder.hpp"
#include "caret_trace/recordable_data.hpp"
#include "caret_trace/singleton.hpp"

#include <cassert>
#include <initializer_list>
#include <memory>
Expand All @@ -26,6 +22,10 @@
#include <utility>
#include <vector>

#include "caret_trace/data_recorder.hpp"
#include "caret_trace/recordable_data.hpp"
#include "caret_trace/singleton.hpp"

DataContainer::DataContainer()
: DataContainer(
std::make_shared<AddCallbackGroup::KeysT>("add_callback_group"),
Expand Down Expand Up @@ -195,15 +195,9 @@ void DataContainer::start_recording()
}
}

void DataContainer::reset()
{
recorder_->reset();
}
void DataContainer::reset() { recorder_->reset(); }

std::vector<std::string> DataContainer::trace_points() const
{
return recorder_->trace_points();
}
std::vector<std::string> DataContainer::trace_points() const { return recorder_->trace_points(); }

void DataContainer::assign_add_callback_group(AddCallbackGroup::StdFuncT record)
{
Expand Down
10 changes: 4 additions & 6 deletions CARET_trace/src/data_recorder.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

#include "caret_trace/data_recorder.hpp"

#include "caret_trace/recordable_data.hpp"
#include "caret_trace/singleton.hpp"

#include <cassert>
#include <initializer_list>
#include <memory>
Expand All @@ -25,9 +22,10 @@
#include <utility>
#include <vector>

DataRecorder::DataRecorder()
{
}
#include "caret_trace/recordable_data.hpp"
#include "caret_trace/singleton.hpp"

DataRecorder::DataRecorder() {}

DataRecorder::DataRecorder(std::initializer_list<std::shared_ptr<RecordableDataInterface>> data)
: DataRecorder(std::vector<std::shared_ptr<RecordableDataInterface>>(data))
Expand Down
10 changes: 5 additions & 5 deletions CARET_trace/src/hooked_trace_points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "rcl/rcl.h"
#include "rcutils/shared_library.h"
#include "rmw/event.h"
#include "rmw/rmw.h"

#include <dlfcn.h>

#include <functional>
Expand All @@ -28,6 +23,11 @@
#include <unordered_set>
#include <vector>

#include "rcl/rcl.h"
#include "rcutils/shared_library.h"
#include "rmw/event.h"
#include "rmw/rmw.h"

#define TRACEPOINT_DEFINE
#include "caret_trace/context.hpp"
#include "caret_trace/singleton.hpp"
Expand Down
8 changes: 2 additions & 6 deletions CARET_trace/src/lttng_session.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

#include "caret_trace/lttng_session.hpp"

#include <rclcpp/rclcpp.hpp>

#include <chrono>
#include <iostream>
#include <memory>
#include <mutex>
#include <rclcpp/rclcpp.hpp>

bool LttngSessionImpl::is_session_running() const
{
Expand All @@ -37,7 +36,4 @@ bool LttngSessionImpl::is_session_running() const
return is_session_running;
}

bool LttngSessionImpl::started_session_running() const
{
return started_session_running_;
}
bool LttngSessionImpl::started_session_running() const { return started_session_running_; }
18 changes: 9 additions & 9 deletions CARET_trace/src/ros_trace_points.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@
#define ros_trace_rmw_publisher_init ros_trace_rmw_publisher_init_disabled
#define ros_trace_rmw_subscription_init ros_trace_rmw_subscription_init_disabled

#include "caret_trace/clock.hpp"
#include "caret_trace/context.hpp"
#include "caret_trace/singleton.hpp"
#include "caret_trace/tp.h"
#include "caret_trace/trace_node.hpp"
#include "caret_trace/tracing_controller.hpp"
#include "rcl/context.h"
#include "rclcpp/rclcpp.hpp"

#include <dlfcn.h>
#include <sys/types.h>
#include <time.h>
Expand All @@ -39,6 +30,15 @@
#include <string>
#include <thread>

#include "caret_trace/clock.hpp"
#include "caret_trace/context.hpp"
#include "caret_trace/singleton.hpp"
#include "caret_trace/tp.h"
#include "caret_trace/trace_node.hpp"
#include "caret_trace/tracing_controller.hpp"
#include "rcl/context.h"
#include "rclcpp/rclcpp.hpp"

#undef ros_trace_rclcpp_publish
#undef ros_trace_rclcpp_service_callback_added
#undef ros_trace_rmw_publisher_init
Expand Down
Loading

0 comments on commit 17db2b0

Please sign in to comment.