diff --git a/BUILD b/BUILD index 6622b21..8e7515e 100644 --- a/BUILD +++ b/BUILD @@ -80,9 +80,9 @@ exports_files([ test_suite( name = "unit_tests", tests = [ - "//feo-logger:libfeo_logger_rust_test", - "//feo-time:libfeo_time_cc_test", - "//feo-time:libfeo_time_test", - "//logd:liblogd_test", + "//src/feo-logger:libfeo_logger_rust_test", + "//src/feo-time:libfeo_time_cc_test", + "//src/feo-time:libfeo_time_test", + "//src/logd:liblogd_test", ], ) diff --git a/examples/rust/cycle-benchmark/BUILD.bazel b/examples/rust/cycle-benchmark/BUILD.bazel index 96ad5ff..5a72843 100644 --- a/examples/rust/cycle-benchmark/BUILD.bazel +++ b/examples/rust/cycle-benchmark/BUILD.bazel @@ -29,12 +29,12 @@ rust_library( ], visibility = ["//visibility:public"], deps = [ - "//feo:libfeo_recording_rust", - "//feo-com:libfeo_com_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_recording_rust", + "//src/feo-com:libfeo_com_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", "@score_crates//:postcard", "@score_crates//:serde", "@score_crates//:serde_json", @@ -55,10 +55,10 @@ rust_binary( visibility = ["//visibility:public"], deps = [ ":libcycle_benchmark_rust", - "//feo:libfeo_recording_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_recording_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", ], ) diff --git a/examples/rust/mini-adas/BUILD.bazel b/examples/rust/mini-adas/BUILD.bazel index 73b059e..dab8742 100644 --- a/examples/rust/mini-adas/BUILD.bazel +++ b/examples/rust/mini-adas/BUILD.bazel @@ -29,18 +29,18 @@ rust_library( ], crate_name = "mini_adas", proc_macro_deps = [ - "//feo-cpp-macros:feo_cpp_macros_rust", + "//src/feo-cpp-macros:feo_cpp_macros_rust", ], visibility = ["//visibility:public"], deps = [ ":cpp_activities", - "//feo:libfeo_rust", - "//feo-com:libfeo_com_rust", - "//feo-cpp-build:libfeo_cpp_build_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_rust", + "//src/feo-com:libfeo_com_rust", + "//src/feo-cpp-build:libfeo_cpp_build_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", "@score_crates//:tracing", ], ) @@ -62,18 +62,18 @@ rust_library( ], crate_name = "mini_adas", proc_macro_deps = [ - "//feo-cpp-macros:feo_cpp_macros_rust", + "//src/feo-cpp-macros:feo_cpp_macros_rust", ], visibility = ["//visibility:public"], deps = [ ":cpp_activities", - "//feo:libfeo_recording_rust", - "//feo-com:libfeo_com_rust", - "//feo-cpp-build:libfeo_cpp_build_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_recording_rust", + "//src/feo-com:libfeo_com_rust", + "//src/feo-cpp-build:libfeo_cpp_build_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", "@score_crates//:postcard", "@score_crates//:serde", "@score_crates//:tracing", @@ -94,11 +94,11 @@ rust_binary( visibility = ["//visibility:public"], deps = [ ":libmini_adas_rust", - "//feo:libfeo_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", ], ) @@ -116,11 +116,11 @@ rust_binary( visibility = ["//visibility:public"], deps = [ ":libmini_adas_rust", - "//feo:libfeo_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", ], ) @@ -136,11 +136,11 @@ rust_binary( visibility = ["//visibility:public"], deps = [ ":libmini_adas_recording_rust", - "//feo:libfeo_recording_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_recording_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", ], ) @@ -153,10 +153,10 @@ rust_binary( visibility = ["//visibility:public"], deps = [ ":libmini_adas_recording_rust", - "//feo:libfeo_recording_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_recording_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-tracing:libfeo_tracing_rust", "@score_crates//:postcard", "@score_crates//:serde", ], @@ -174,9 +174,9 @@ cc_library( ], includes = [ "src/include", - "//feo-cpp-build:src/include", + "//src/feo-cpp-build:src/include", ], deps = [ - "//feo-cpp-build:libfeo_cpp_build_cc", + "//src/feo-cpp-build:libfeo_cpp_build_cc", ], ) diff --git a/examples/rust/mini-adas/README.md b/examples/rust/mini-adas/README.md index 19c8100..6352e8f 100644 --- a/examples/rust/mini-adas/README.md +++ b/examples/rust/mini-adas/README.md @@ -85,12 +85,12 @@ any secondaries or recorders, because mpsc does not support inter-process signal In order to start tracing use: ```sh -bazel run //feo-tracer:feo_tracer -- -o out.dat +bazel run //src/feo-tracer:feo_tracer -- -o out.dat ``` where `out.dat` is the tracing data output. You can specify the tracing duration in seconds and log level using: ```sh -bazel run //feo-tracer:feo_tracer -- -d 10 -l INFO -o out.dat +bazel run //src/feo-tracer:feo_tracer -- -d 10 -l INFO -o out.dat ``` diff --git a/feo-com/src/lib.rs b/feo-com/src/lib.rs deleted file mode 100644 index f8a77f0..0000000 --- a/feo-com/src/lib.rs +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Topic based communication - -#![no_std] -#![deny( - clippy::std_instead_of_core, - clippy::std_instead_of_alloc, - clippy::alloc_instead_of_core -)] - -extern crate alloc; -extern crate std; - -pub mod interface; -#[cfg(feature = "ipc_iceoryx2")] -pub mod iox2; -#[cfg(feature = "ipc_linux_shm")] -pub mod linux_shm; diff --git a/feo-log/src/lib.rs b/feo-log/src/lib.rs deleted file mode 100644 index d066025..0000000 --- a/feo-log/src/lib.rs +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! The score-feo logging facade. -//! -//! Use what's proven. Use what used out there. No - we're not special. - -#![no_std] -#![deny( - clippy::std_instead_of_core, - clippy::std_instead_of_alloc, - clippy::alloc_instead_of_core -)] - -pub use log::*; diff --git a/feo-logger/src/console.rs b/feo-logger/src/console.rs deleted file mode 100644 index d5b282c..0000000 --- a/feo-logger/src/console.rs +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -use crate::fmt; -use crate::record::Record; -use std::io::{self}; - -#[derive(Debug, Default)] -pub struct Console; - -impl Console { - pub fn write(&self, record: &Record) -> io::Result<()> { - fmt::format(record, io::stdout()) - } -} diff --git a/feo-logger/src/ffi.rs b/feo-logger/src/ffi.rs deleted file mode 100644 index 6371554..0000000 --- a/feo-logger/src/ffi.rs +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -use std::ffi::c_int; - -#[unsafe(no_mangle)] -extern "C" fn __init(level_filter: c_int, console: bool, logd: bool) { - let level_filter = match level_filter { - 0 => feo_log::LevelFilter::Off, - 1 => feo_log::LevelFilter::Error, - 2 => feo_log::LevelFilter::Warn, - 3 => feo_log::LevelFilter::Info, - 4 => feo_log::LevelFilter::Debug, - 5 => feo_log::LevelFilter::Trace, - _ => panic!("invalid level filter"), - }; - feo_logger::init(level_filter, console, logd); -} diff --git a/feo-logger/src/thread.rs b/feo-logger/src/thread.rs deleted file mode 100644 index 96ab4b2..0000000 --- a/feo-logger/src/thread.rs +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -/// The type of a thread id -pub type ThreadId = u32; - -/// Get the current thread id -pub fn id() -> ThreadId { - // Safety: gettid(2) says this never fails - unsafe { libc::gettid() as u32 } -} diff --git a/feo-tracer/src/lib.rs b/feo-tracer/src/lib.rs deleted file mode 100644 index 7d4f32b..0000000 --- a/feo-tracer/src/lib.rs +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Central trace collector - -pub mod data; -pub mod io; -pub mod perfetto; diff --git a/feo-tracing/src/lib.rs b/feo-tracing/src/lib.rs deleted file mode 100644 index 07fa635..0000000 --- a/feo-tracing/src/lib.rs +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Tracing library for the FEO project. - -/// The `subscriber` module contains the `Subscriber` struct, which is a custom `tracing` subscriber. -/// The tracing data is forward to `feo-tracer` -#[path = "subscriber.rs"] -mod feo_subscriber; -pub mod protocol; - -/// Initialize tracing -pub use feo_subscriber::init; -/// Re-export of the `tracing` crate. -pub use tracing::{self, event, instrument, level_filters::LevelFilter, span, Level}; diff --git a/feo/src/agent/direct/mod.rs b/feo/src/agent/direct/mod.rs deleted file mode 100644 index 7e41d45..0000000 --- a/feo/src/agent/direct/mod.rs +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Agent implementation for direct scheduler-to-worker signalling -//! -//! The scheduler connects directly to each worker, independent of whether -//! the worker runs in the same process or another process. - -pub mod primary; -pub mod primary_mpsc; -#[cfg(feature = "recording")] -pub mod recorder; -pub mod secondary; diff --git a/feo/src/agent/mod.rs b/feo/src/agent/mod.rs deleted file mode 100644 index 2f23ce4..0000000 --- a/feo/src/agent/mod.rs +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! FEO agents are processes. -//! -//! In each FEO application there is one primary agent and optional secondary -//! agents. The primary agent is responsible for triggering the execution of all activities distributed -//! across all agents. - -use core::net::SocketAddr; -use std::path::PathBuf; - -pub mod com_init; -pub mod direct; -pub mod relayed; - -/// Node address of a connection -#[derive(Debug, Clone)] -pub enum NodeAddress { - Tcp(SocketAddr), - UnixSocket(PathBuf), -} diff --git a/feo/src/recording/mod.rs b/feo/src/recording/mod.rs deleted file mode 100644 index 6c3be46..0000000 --- a/feo/src/recording/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -#[cfg(feature = "recording")] -pub mod recorder; - -#[cfg(feature = "recording")] -pub mod registry; - -#[cfg(feature = "recording")] -mod transcoder; diff --git a/feo/src/signalling/common/mod.rs b/feo/src/signalling/common/mod.rs deleted file mode 100644 index 20968e7..0000000 --- a/feo/src/signalling/common/mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Common blocks shared in different signalling layers - -pub(crate) mod interface; -pub(crate) mod mpsc; -pub(crate) mod signals; -pub(crate) mod socket; diff --git a/feo/src/signalling/common/mpsc/mod.rs b/feo/src/signalling/common/mpsc/mod.rs deleted file mode 100644 index 962101c..0000000 --- a/feo/src/signalling/common/mpsc/mod.rs +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Mpsc-only signalling module -//! -//! Mpsc-only signalling does not allow for inter-process communication. Therefore -//! it is not applicable for multi-process setups. - -pub(crate) use crate::signalling::common::mpsc::worker::WorkerConnector; -use alloc::boxed::Box; - -pub(crate) mod endpoint; -pub(crate) mod primitives; -pub(crate) mod worker; - -pub type Builder = Box T + Send>; -pub type WorkerConnectorBuilder = Builder; diff --git a/feo/src/signalling/direct/mod.rs b/feo/src/signalling/direct/mod.rs deleted file mode 100644 index 682cb23..0000000 --- a/feo/src/signalling/direct/mod.rs +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Signalling layer with direct connection between scheduler and workers -//! -//! This module provides connector implementations which establish direct connections -//! between the scheduler and every worker. -//! The layer does not differentiate between connecting workers in other processes -//! or in the same process as the scheduler. - -pub(crate) mod mpsc; -#[cfg(feature = "recording")] -pub(crate) mod recorder; -pub(crate) mod scheduler; -pub(crate) mod worker; diff --git a/feo/src/signalling/direct/mpsc/mod.rs b/feo/src/signalling/direct/mpsc/mod.rs deleted file mode 100644 index 0fb3c20..0000000 --- a/feo/src/signalling/direct/mpsc/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Elements for mpsc-based signalling - -pub(crate) mod scheduler; diff --git a/feo/src/signalling/mod.rs b/feo/src/signalling/mod.rs deleted file mode 100644 index 7b725ea..0000000 --- a/feo/src/signalling/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Signalling module -//! -//! This module defines interfaces and implementation variants for signalling. - -pub(crate) mod common; -pub(crate) mod direct; -pub(crate) mod relayed; diff --git a/feo/src/signalling/relayed/connectors/mod.rs b/feo/src/signalling/relayed/connectors/mod.rs deleted file mode 100644 index 04b61b9..0000000 --- a/feo/src/signalling/relayed/connectors/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Signalling connectors and relays for various feo components - -#[cfg(feature = "recording")] -pub(crate) mod recorder; -pub(crate) mod relays; -pub(crate) mod scheduler; -pub(crate) mod secondary; diff --git a/feo/src/signalling/relayed/mpsc/mod.rs b/feo/src/signalling/relayed/mpsc/mod.rs deleted file mode 100644 index 132f6fc..0000000 --- a/feo/src/signalling/relayed/mpsc/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Elements for mpsc-based signalling - -pub(crate) mod endpoint; diff --git a/feo/src/signalling/relayed/sockets/mod.rs b/feo/src/signalling/relayed/sockets/mod.rs deleted file mode 100644 index b4ab893..0000000 --- a/feo/src/signalling/relayed/sockets/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Elements for socket-based signalling - -pub(crate) mod endpoint; diff --git a/feo/tests/smoke.rs b/feo/tests/smoke.rs deleted file mode 100644 index 0d7a6a4..0000000 --- a/feo/tests/smoke.rs +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -/// Empty smoke test to make sure the tests are running -#[test] -fn smoke() {} diff --git a/logd/src/main.rs b/logd/src/main.rs deleted file mode 100644 index a4b85ab..0000000 --- a/logd/src/main.rs +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -//! Placeholder logging daemon that collects logs from various sources. Minimal effort implementation. - -use anyhow::Error; -use feo_log::{info, LevelFilter}; -use tokio::runtime; - -fn main() -> Result<(), Error> { - // Initialize the logger *without* the logd part logger. - feo_logger::init(LevelFilter::Debug, true, false); - - info!("Starting logd"); - - let logd = logd::run(); - - runtime::Builder::new_current_thread() - .enable_io() - .build()? - .block_on(logd) -} diff --git a/perfetto-model/build.rs b/perfetto-model/build.rs deleted file mode 100644 index 4198fb9..0000000 --- a/perfetto-model/build.rs +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -fn main() -> std::io::Result<()> { - prost_build::compile_protos(&["protos/perfetto_trace.proto"], &["protos"]).map(drop) -} diff --git a/perfetto-model/src/lib.rs b/perfetto-model/src/lib.rs deleted file mode 100644 index c295b8e..0000000 --- a/perfetto-model/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -pub use perfetto_proto::perfetto::protos::*; diff --git a/feo-com/BUILD.bazel b/src/feo-com/BUILD.bazel similarity index 97% rename from feo-com/BUILD.bazel rename to src/feo-com/BUILD.bazel index 75f5498..cee6959 100644 --- a/feo-com/BUILD.bazel +++ b/src/feo-com/BUILD.bazel @@ -33,7 +33,7 @@ rust_library( crate_name = "feo_com", visibility = ["//visibility:public"], deps = [ - "//feo-log:libfeo_log_rust", + "//src/feo-log:libfeo_log_rust", # all_crate_deps only contains optional dependencies which are default-activated, # so we add all optional dependencies here to be independent of cargo default features # Disabled due to compilation error of iceoryx2 diff --git a/feo-com/Cargo.toml b/src/feo-com/Cargo.toml similarity index 100% rename from feo-com/Cargo.toml rename to src/feo-com/Cargo.toml diff --git a/feo-com/src/interface.rs b/src/feo-com/src/interface.rs similarity index 95% rename from feo-com/src/interface.rs rename to src/feo-com/src/interface.rs index 9a859b4..5f23107 100644 --- a/feo-com/src/interface.rs +++ b/src/feo-com/src/interface.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Communication interface //! diff --git a/feo-com/src/iox2/mod.rs b/src/feo-com/src/iox2/mod.rs similarity index 93% rename from feo-com/src/iox2/mod.rs rename to src/feo-com/src/iox2/mod.rs index f3b2f43..e940315 100644 --- a/feo-com/src/iox2/mod.rs +++ b/src/feo-com/src/iox2/mod.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! iceoryx2 com backend diff --git a/src/feo-com/src/lib.rs b/src/feo-com/src/lib.rs new file mode 100644 index 0000000..a1aad03 --- /dev/null +++ b/src/feo-com/src/lib.rs @@ -0,0 +1,30 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Topic based communication + +#![no_std] +#![deny( + clippy::std_instead_of_core, + clippy::std_instead_of_alloc, + clippy::alloc_instead_of_core +)] + +extern crate alloc; +extern crate std; + +pub mod interface; +#[cfg(feature = "ipc_iceoryx2")] +pub mod iox2; +#[cfg(feature = "ipc_linux_shm")] +pub mod linux_shm; diff --git a/feo-com/src/linux_shm/mod.rs b/src/feo-com/src/linux_shm/mod.rs similarity index 96% rename from feo-com/src/linux_shm/mod.rs rename to src/feo-com/src/linux_shm/mod.rs index 6ba3a2b..a8e28e9 100644 --- a/feo-com/src/linux_shm/mod.rs +++ b/src/feo-com/src/linux_shm/mod.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Basic shared memory com backend //! diff --git a/feo-com/src/linux_shm/shared_memory.rs b/src/feo-com/src/linux_shm/shared_memory.rs similarity index 92% rename from feo-com/src/linux_shm/shared_memory.rs rename to src/feo-com/src/linux_shm/shared_memory.rs index cd214f3..fcbfc22 100644 --- a/feo-com/src/linux_shm/shared_memory.rs +++ b/src/feo-com/src/linux_shm/shared_memory.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use alloc::sync::Arc; use core::any::TypeId; diff --git a/feo-cpp-build/BUILD.bazel b/src/feo-cpp-build/BUILD.bazel similarity index 100% rename from feo-cpp-build/BUILD.bazel rename to src/feo-cpp-build/BUILD.bazel diff --git a/feo-cpp-build/Cargo.toml b/src/feo-cpp-build/Cargo.toml similarity index 100% rename from feo-cpp-build/Cargo.toml rename to src/feo-cpp-build/Cargo.toml diff --git a/feo-cpp-build/src/include/feo_cpp/feo_macros.h b/src/feo-cpp-build/src/include/feo_cpp/feo_macros.h similarity index 100% rename from feo-cpp-build/src/include/feo_cpp/feo_macros.h rename to src/feo-cpp-build/src/include/feo_cpp/feo_macros.h diff --git a/feo-cpp-build/src/lib.rs b/src/feo-cpp-build/src/lib.rs similarity index 67% rename from feo-cpp-build/src/lib.rs rename to src/feo-cpp-build/src/lib.rs index 8b471c9..a4f6460 100644 --- a/feo-cpp-build/src/lib.rs +++ b/src/feo-cpp-build/src/lib.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Helpers for building C++ components for FEO diff --git a/feo-cpp-macros/BUILD.bazel b/src/feo-cpp-macros/BUILD.bazel similarity index 100% rename from feo-cpp-macros/BUILD.bazel rename to src/feo-cpp-macros/BUILD.bazel diff --git a/feo-cpp-macros/Cargo.toml b/src/feo-cpp-macros/Cargo.toml similarity index 100% rename from feo-cpp-macros/Cargo.toml rename to src/feo-cpp-macros/Cargo.toml diff --git a/feo-cpp-macros/src/lib.rs b/src/feo-cpp-macros/src/lib.rs similarity index 85% rename from feo-cpp-macros/src/lib.rs rename to src/feo-cpp-macros/src/lib.rs index de7d664..f71cd7c 100644 --- a/feo-cpp-macros/src/lib.rs +++ b/src/feo-cpp-macros/src/lib.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Macros supporting building of C++ components for FEO diff --git a/feo-log/BUILD.bazel b/src/feo-log/BUILD.bazel similarity index 94% rename from feo-log/BUILD.bazel rename to src/feo-log/BUILD.bazel index 8856ac2..5d96a4f 100644 --- a/feo-log/BUILD.bazel +++ b/src/feo-log/BUILD.bazel @@ -59,7 +59,7 @@ rust_binary( ], deps = [ ":libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", + "//src/feo-logger:libfeo_logger_rust", ], ) @@ -70,6 +70,6 @@ cc_binary( ], deps = [ ":libfeo_log_cpp", - "//feo-logger:libfeo_logger_cpp", + "//src/feo-logger:libfeo_logger_cpp", ], ) diff --git a/feo-log/Cargo.toml b/src/feo-log/Cargo.toml similarity index 100% rename from feo-log/Cargo.toml rename to src/feo-log/Cargo.toml diff --git a/feo-log/examples/hello.cc b/src/feo-log/examples/hello.cc similarity index 100% rename from feo-log/examples/hello.cc rename to src/feo-log/examples/hello.cc diff --git a/feo-log/examples/hello.rs b/src/feo-log/examples/hello.rs similarity index 59% rename from feo-log/examples/hello.rs rename to src/feo-log/examples/hello.rs index 9783773..3e9c201 100644 --- a/feo-log/examples/hello.rs +++ b/src/feo-log/examples/hello.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use core::time; use feo_log::{error, log, warn, Level, LevelFilter}; diff --git a/feo-log/include/log.h b/src/feo-log/include/log.h similarity index 100% rename from feo-log/include/log.h rename to src/feo-log/include/log.h diff --git a/feo-log/src/ffi.rs b/src/feo-log/src/ffi.rs similarity index 84% rename from feo-log/src/ffi.rs rename to src/feo-log/src/ffi.rs index 95a326d..7944ee0 100644 --- a/feo-log/src/ffi.rs +++ b/src/feo-log/src/ffi.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use log::{Level, LevelFilter, Record}; use std::ffi::{c_char, c_int, CStr}; diff --git a/src/feo-log/src/lib.rs b/src/feo-log/src/lib.rs new file mode 100644 index 0000000..80686da --- /dev/null +++ b/src/feo-log/src/lib.rs @@ -0,0 +1,25 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! The score-feo logging facade. +//! +//! Use what's proven. Use what used out there. No - we're not special. + +#![no_std] +#![deny( + clippy::std_instead_of_core, + clippy::std_instead_of_alloc, + clippy::alloc_instead_of_core +)] + +pub use log::*; diff --git a/feo-log/src/log.cc b/src/feo-log/src/log.cc similarity index 100% rename from feo-log/src/log.cc rename to src/feo-log/src/log.cc diff --git a/feo-logger/BUILD.bazel b/src/feo-logger/BUILD.bazel similarity index 90% rename from feo-logger/BUILD.bazel rename to src/feo-logger/BUILD.bazel index 6357d30..7b26c6d 100644 --- a/feo-logger/BUILD.bazel +++ b/src/feo-logger/BUILD.bazel @@ -26,8 +26,8 @@ rust_library( crate_name = "feo_logger", visibility = ["//visibility:public"], deps = [ - "//feo-log:libfeo_log_rust", - "//feo-time:libfeo_time_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-time:libfeo_time_rust", "@score_crates//:console", "@score_crates//:libc", "@score_crates//:time", @@ -48,7 +48,7 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":libfeo_logger_ffi_rust", - "//feo-log:libfeo_log_cpp", + "//src/feo-log:libfeo_log_cpp", ], ) @@ -60,7 +60,7 @@ rust_static_library( ], deps = [ ":libfeo_logger_rust", - "//feo-log:libfeo_log_rust", + "//src/feo-log:libfeo_log_rust", ], ) diff --git a/feo-logger/Cargo.toml b/src/feo-logger/Cargo.toml similarity index 100% rename from feo-logger/Cargo.toml rename to src/feo-logger/Cargo.toml diff --git a/feo-logger/README.md b/src/feo-logger/README.md similarity index 100% rename from feo-logger/README.md rename to src/feo-logger/README.md diff --git a/feo-logger/include/logger.h b/src/feo-logger/include/logger.h similarity index 100% rename from feo-logger/include/logger.h rename to src/feo-logger/include/logger.h diff --git a/src/feo-logger/src/console.rs b/src/feo-logger/src/console.rs new file mode 100644 index 0000000..00b400f --- /dev/null +++ b/src/feo-logger/src/console.rs @@ -0,0 +1,25 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +use crate::fmt; +use crate::record::Record; +use std::io::{self}; + +#[derive(Debug, Default)] +pub struct Console; + +impl Console { + pub fn write(&self, record: &Record) -> io::Result<()> { + fmt::format(record, io::stdout()) + } +} diff --git a/src/feo-logger/src/ffi.rs b/src/feo-logger/src/ffi.rs new file mode 100644 index 0000000..776612b --- /dev/null +++ b/src/feo-logger/src/ffi.rs @@ -0,0 +1,28 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +use std::ffi::c_int; + +#[unsafe(no_mangle)] +extern "C" fn __init(level_filter: c_int, console: bool, logd: bool) { + let level_filter = match level_filter { + 0 => feo_log::LevelFilter::Off, + 1 => feo_log::LevelFilter::Error, + 2 => feo_log::LevelFilter::Warn, + 3 => feo_log::LevelFilter::Info, + 4 => feo_log::LevelFilter::Debug, + 5 => feo_log::LevelFilter::Trace, + _ => panic!("invalid level filter"), + }; + feo_logger::init(level_filter, console, logd); +} diff --git a/feo-logger/src/fmt.rs b/src/feo-logger/src/fmt.rs similarity index 89% rename from feo-logger/src/fmt.rs rename to src/feo-logger/src/fmt.rs index 0c5af0d..0bdf3f4 100644 --- a/feo-logger/src/fmt.rs +++ b/src/feo-logger/src/fmt.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::record::{OwnedRecord, Record}; use console::{style, Color, StyledObject}; diff --git a/feo-logger/src/lib.rs b/src/feo-logger/src/lib.rs similarity index 84% rename from feo-logger/src/lib.rs rename to src/feo-logger/src/lib.rs index 9326a6c..dd59f2c 100644 --- a/feo-logger/src/lib.rs +++ b/src/feo-logger/src/lib.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! The score-feo-logger //! diff --git a/feo-logger/src/logd.rs b/src/feo-logger/src/logd.rs similarity index 84% rename from feo-logger/src/logd.rs rename to src/feo-logger/src/logd.rs index a8e693f..ecd5ba5 100644 --- a/feo-logger/src/logd.rs +++ b/src/feo-logger/src/logd.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::record::Record; use crate::MAX_RECORD_SIZE; diff --git a/feo-logger/src/logger.cc b/src/feo-logger/src/logger.cc similarity index 100% rename from feo-logger/src/logger.cc rename to src/feo-logger/src/logger.cc diff --git a/feo-logger/src/record.rs b/src/feo-logger/src/record.rs similarity index 93% rename from feo-logger/src/record.rs rename to src/feo-logger/src/record.rs index 8bfc1f7..8a82c8e 100644 --- a/feo-logger/src/record.rs +++ b/src/feo-logger/src/record.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use core::mem::size_of; use core::time::Duration; diff --git a/src/feo-logger/src/thread.rs b/src/feo-logger/src/thread.rs new file mode 100644 index 0000000..2e8d431 --- /dev/null +++ b/src/feo-logger/src/thread.rs @@ -0,0 +1,21 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +/// The type of a thread id +pub type ThreadId = u32; + +/// Get the current thread id +pub fn id() -> ThreadId { + // Safety: gettid(2) says this never fails + unsafe { libc::gettid() as u32 } +} diff --git a/feo-time/BUILD.bazel b/src/feo-time/BUILD.bazel similarity index 93% rename from feo-time/BUILD.bazel rename to src/feo-time/BUILD.bazel index e886bb9..c626012 100644 --- a/feo-time/BUILD.bazel +++ b/src/feo-time/BUILD.bazel @@ -49,7 +49,7 @@ rust_static_library( "src/ffi.rs", "src/lib.rs", ], - deps = ["//feo-time:libfeo_time_rust"], + deps = ["//src/feo-time:libfeo_time_rust"], ) # Rust library tests @@ -78,7 +78,7 @@ rust_binary( ], deps = [ ":libfeo_time_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", ], ) diff --git a/feo-time/Cargo.toml b/src/feo-time/Cargo.toml similarity index 100% rename from feo-time/Cargo.toml rename to src/feo-time/Cargo.toml diff --git a/feo-time/examples/time_speedrun.rs b/src/feo-time/examples/time_speedrun.rs similarity index 77% rename from feo-time/examples/time_speedrun.rs rename to src/feo-time/examples/time_speedrun.rs index 4395e94..1041d02 100644 --- a/feo-time/examples/time_speedrun.rs +++ b/src/feo-time/examples/time_speedrun.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use core::time::Duration; use feo_log::{debug, info, LevelFilter}; diff --git a/feo-time/include/feo_time.h b/src/feo-time/include/feo_time.h similarity index 100% rename from feo-time/include/feo_time.h rename to src/feo-time/include/feo_time.h diff --git a/feo-time/src/ffi.rs b/src/feo-time/src/ffi.rs similarity index 52% rename from feo-time/src/ffi.rs rename to src/feo-time/src/ffi.rs index 879a959..55405f6 100644 --- a/feo-time/src/ffi.rs +++ b/src/feo-time/src/ffi.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::SystemTime; diff --git a/feo-time/src/lib.rs b/src/feo-time/src/lib.rs similarity index 97% rename from feo-time/src/lib.rs rename to src/feo-time/src/lib.rs index 731e9fb..71a08d7 100644 --- a/feo-time/src/lib.rs +++ b/src/feo-time/src/lib.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! FEO Temporal quantification. //! diff --git a/feo-time/src/tests.rs b/src/feo-time/src/tests.rs similarity index 93% rename from feo-time/src/tests.rs rename to src/feo-time/src/tests.rs index 1cf6480..18e5364 100644 --- a/feo-time/src/tests.rs +++ b/src/feo-time/src/tests.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::{Duration, Instant, SystemTime, UNIX_EPOCH}; use alloc::vec::Vec; diff --git a/feo-time/tests/time_test.cc b/src/feo-time/tests/time_test.cc similarity index 100% rename from feo-time/tests/time_test.cc rename to src/feo-time/tests/time_test.cc diff --git a/feo-tracer/BUILD.bazel b/src/feo-tracer/BUILD.bazel similarity index 88% rename from feo-tracer/BUILD.bazel rename to src/feo-tracer/BUILD.bazel index 2be2cca..384b2b9 100644 --- a/feo-tracer/BUILD.bazel +++ b/src/feo-tracer/BUILD.bazel @@ -23,8 +23,8 @@ rust_binary( visibility = ["//visibility:public"], deps = [ ":libfeo_tracer", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", "@score_crates//:anyhow", "@score_crates//:argh", "@score_crates//:futures", @@ -45,9 +45,9 @@ rust_library( crate_name = "feo_tracer", visibility = ["//visibility:public"], deps = [ - "//feo-log:libfeo_log_rust", - "//feo-tracing:libfeo_tracing_rust", - "//perfetto-model", + "//src/feo-log:libfeo_log_rust", + "//src/feo-tracing:libfeo_tracing_rust", + "//src/perfetto-model", "@score_crates//:anyhow", "@score_crates//:human_bytes", "@score_crates//:indicatif", diff --git a/feo-tracer/Cargo.toml b/src/feo-tracer/Cargo.toml similarity index 100% rename from feo-tracer/Cargo.toml rename to src/feo-tracer/Cargo.toml diff --git a/feo-tracer/src/data.rs b/src/feo-tracer/src/data.rs similarity index 88% rename from feo-tracer/src/data.rs rename to src/feo-tracer/src/data.rs index 3d32426..42299d8 100644 --- a/feo-tracer/src/data.rs +++ b/src/feo-tracer/src/data.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::io::ThreadNameCache; use anyhow::Error; diff --git a/feo-tracer/src/io.rs b/src/feo-tracer/src/io.rs similarity index 90% rename from feo-tracer/src/io.rs rename to src/feo-tracer/src/io.rs index 406a59f..5729ca4 100644 --- a/feo-tracer/src/io.rs +++ b/src/feo-tracer/src/io.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Collect trace data - placeholder diff --git a/src/feo-tracer/src/lib.rs b/src/feo-tracer/src/lib.rs new file mode 100644 index 0000000..3434c91 --- /dev/null +++ b/src/feo-tracer/src/lib.rs @@ -0,0 +1,18 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Central trace collector + +pub mod data; +pub mod io; +pub mod perfetto; diff --git a/feo-tracer/src/main.rs b/src/feo-tracer/src/main.rs similarity index 89% rename from feo-tracer/src/main.rs rename to src/feo-tracer/src/main.rs index a7836fa..7fc1ff3 100644 --- a/feo-tracer/src/main.rs +++ b/src/feo-tracer/src/main.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Collect trace data - placeholder diff --git a/feo-tracer/src/perfetto.rs b/src/feo-tracer/src/perfetto.rs similarity index 95% rename from feo-tracer/src/perfetto.rs rename to src/feo-tracer/src/perfetto.rs index 7a28a5f..788066b 100644 --- a/feo-tracer/src/perfetto.rs +++ b/src/feo-tracer/src/perfetto.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::data::{RecordData, RecordEventInfo, Thread, TraceRecord}; use anyhow::{bail, Error}; diff --git a/feo-tracer/src/progress.rs b/src/feo-tracer/src/progress.rs similarity index 88% rename from feo-tracer/src/progress.rs rename to src/feo-tracer/src/progress.rs index b1d1819..1811743 100644 --- a/feo-tracer/src/progress.rs +++ b/src/feo-tracer/src/progress.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use anyhow::Error; use feo_tracer::data; diff --git a/feo-tracing/BUILD.bazel b/src/feo-tracing/BUILD.bazel similarity index 90% rename from feo-tracing/BUILD.bazel rename to src/feo-tracing/BUILD.bazel index 989b213..bddf2a9 100644 --- a/feo-tracing/BUILD.bazel +++ b/src/feo-tracing/BUILD.bazel @@ -23,7 +23,7 @@ rust_library( crate_name = "feo_tracing", visibility = ["//visibility:public"], deps = [ - "//feo-log:libfeo_log_rust", + "//src/feo-log:libfeo_log_rust", "@score_crates//:libc", "@score_crates//:postcard", "@score_crates//:serde", @@ -39,8 +39,8 @@ rust_binary( ], deps = [ ":libfeo_tracing_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", "@score_crates//:tracing", ], ) diff --git a/feo-tracing/Cargo.toml b/src/feo-tracing/Cargo.toml similarity index 100% rename from feo-tracing/Cargo.toml rename to src/feo-tracing/Cargo.toml diff --git a/feo-tracing/README.md b/src/feo-tracing/README.md similarity index 100% rename from feo-tracing/README.md rename to src/feo-tracing/README.md diff --git a/feo-tracing/examples/hello_tracing.rs b/src/feo-tracing/examples/hello_tracing.rs similarity index 76% rename from feo-tracing/examples/hello_tracing.rs rename to src/feo-tracing/examples/hello_tracing.rs index aef1b47..bb43b0f 100644 --- a/feo-tracing/examples/hello_tracing.rs +++ b/src/feo-tracing/examples/hello_tracing.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use core::hash::{BuildHasher, Hasher}; use core::ops::Range; diff --git a/src/feo-tracing/src/lib.rs b/src/feo-tracing/src/lib.rs new file mode 100644 index 0000000..8e3bcd2 --- /dev/null +++ b/src/feo-tracing/src/lib.rs @@ -0,0 +1,25 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Tracing library for the FEO project. + +/// The `subscriber` module contains the `Subscriber` struct, which is a custom `tracing` subscriber. +/// The tracing data is forward to `feo-tracer` +#[path = "subscriber.rs"] +mod feo_subscriber; +pub mod protocol; + +/// Initialize tracing +pub use feo_subscriber::init; +/// Re-export of the `tracing` crate. +pub use tracing::{self, event, instrument, level_filters::LevelFilter, span, Level}; diff --git a/feo-tracing/src/protocol.rs b/src/feo-tracing/src/protocol.rs similarity index 86% rename from feo-tracing/src/protocol.rs rename to src/feo-tracing/src/protocol.rs index ddadb7e..730e5e9 100644 --- a/feo-tracing/src/protocol.rs +++ b/src/feo-tracing/src/protocol.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use core::fmt::Debug; use serde::{Deserialize, Serialize}; diff --git a/feo-tracing/src/subscriber.rs b/src/feo-tracing/src/subscriber.rs similarity index 92% rename from feo-tracing/src/subscriber.rs rename to src/feo-tracing/src/subscriber.rs index 5dd1c63..7c98328 100644 --- a/feo-tracing/src/subscriber.rs +++ b/src/feo-tracing/src/subscriber.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::protocol::{truncate, EventInfo, TraceData, TracePacket, MAX_INFO_SIZE, MAX_PACKET_SIZE}; use core::sync::atomic; diff --git a/feo/BUILD.bazel b/src/feo/BUILD.bazel similarity index 94% rename from feo/BUILD.bazel rename to src/feo/BUILD.bazel index 5b981e2..23f4fe9 100644 --- a/feo/BUILD.bazel +++ b/src/feo/BUILD.bazel @@ -74,10 +74,10 @@ rust_library( crate_name = "feo", visibility = ["//visibility:public"], deps = [ - "//feo-com:libfeo_com_rust", - "//feo-log:libfeo_log_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo-com:libfeo_com_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", "@score_crates//:ctrlc", "@score_crates//:libc", "@score_crates//:mio", @@ -146,10 +146,10 @@ rust_library( crate_name = "feo", visibility = ["//visibility:public"], deps = [ - "//feo-com:libfeo_com_rust", - "//feo-log:libfeo_log_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo-com:libfeo_com_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", "@score_crates//:ctrlc", "@score_crates//:libc", "@score_crates//:mio", diff --git a/feo/Cargo.toml b/src/feo/Cargo.toml similarity index 100% rename from feo/Cargo.toml rename to src/feo/Cargo.toml diff --git a/feo/Design/shutdown_direct_mode_all_agents.png b/src/feo/Design/shutdown_direct_mode_all_agents.png similarity index 100% rename from feo/Design/shutdown_direct_mode_all_agents.png rename to src/feo/Design/shutdown_direct_mode_all_agents.png diff --git a/feo/Design/shutdown_relayed_mode_all_agents.png b/src/feo/Design/shutdown_relayed_mode_all_agents.png similarity index 100% rename from feo/Design/shutdown_relayed_mode_all_agents.png rename to src/feo/Design/shutdown_relayed_mode_all_agents.png diff --git a/feo/Design/shutdown_sequence.md b/src/feo/Design/shutdown_sequence.md similarity index 100% rename from feo/Design/shutdown_sequence.md rename to src/feo/Design/shutdown_sequence.md diff --git a/feo/README.md b/src/feo/README.md similarity index 100% rename from feo/README.md rename to src/feo/README.md diff --git a/feo/src/activity.rs b/src/feo/src/activity.rs similarity index 68% rename from feo/src/activity.rs rename to src/feo/src/activity.rs index ba8c5b9..aa5b736 100644 --- a/feo/src/activity.rs +++ b/src/feo/src/activity.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Activity and related structs and traits use crate::error::ActivityError; diff --git a/feo/src/agent/com_init.rs b/src/feo/src/agent/com_init.rs similarity index 92% rename from feo/src/agent/com_init.rs rename to src/feo/src/agent/com_init.rs index 6f1f1e1..ce91f3d 100644 --- a/feo/src/agent/com_init.rs +++ b/src/feo/src/agent/com_init.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::ids::{ActivityId, AgentId, WorkerId}; use crate::topicspec::{Direction, TopicSpecification}; diff --git a/src/feo/src/agent/direct/mod.rs b/src/feo/src/agent/direct/mod.rs new file mode 100644 index 0000000..95ad273 --- /dev/null +++ b/src/feo/src/agent/direct/mod.rs @@ -0,0 +1,23 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Agent implementation for direct scheduler-to-worker signalling +//! +//! The scheduler connects directly to each worker, independent of whether +//! the worker runs in the same process or another process. + +pub mod primary; +pub mod primary_mpsc; +#[cfg(feature = "recording")] +pub mod recorder; +pub mod secondary; diff --git a/feo/src/agent/direct/primary.rs b/src/feo/src/agent/direct/primary.rs similarity index 91% rename from feo/src/agent/direct/primary.rs rename to src/feo/src/agent/direct/primary.rs index 8a98419..6bfc9d7 100644 --- a/feo/src/agent/direct/primary.rs +++ b/src/feo/src/agent/direct/primary.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Implementation of the primary agent for direct scheduler-to-worker signalling diff --git a/feo/src/agent/direct/primary_mpsc.rs b/src/feo/src/agent/direct/primary_mpsc.rs similarity index 89% rename from feo/src/agent/direct/primary_mpsc.rs rename to src/feo/src/agent/direct/primary_mpsc.rs index 0e2d7b9..46f2888 100644 --- a/feo/src/agent/direct/primary_mpsc.rs +++ b/src/feo/src/agent/direct/primary_mpsc.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Implementation of the primary agent for mpsc-only signalling diff --git a/feo/src/agent/direct/recorder.rs b/src/feo/src/agent/direct/recorder.rs similarity index 78% rename from feo/src/agent/direct/recorder.rs rename to src/feo/src/agent/direct/recorder.rs index b3b296a..7441246 100644 --- a/feo/src/agent/direct/recorder.rs +++ b/src/feo/src/agent/direct/recorder.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Implementation of a recorder for direct scheduler-to-worker signalling diff --git a/feo/src/agent/direct/secondary.rs b/src/feo/src/agent/direct/secondary.rs similarity index 86% rename from feo/src/agent/direct/secondary.rs rename to src/feo/src/agent/direct/secondary.rs index d897be5..7d6c7ce 100644 --- a/feo/src/agent/direct/secondary.rs +++ b/src/feo/src/agent/direct/secondary.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Implementation of a secondary agent for direct scheduler-to-worker signalling diff --git a/src/feo/src/agent/mod.rs b/src/feo/src/agent/mod.rs new file mode 100644 index 0000000..f7b9b20 --- /dev/null +++ b/src/feo/src/agent/mod.rs @@ -0,0 +1,32 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! FEO agents are processes. +//! +//! In each FEO application there is one primary agent and optional secondary +//! agents. The primary agent is responsible for triggering the execution of all activities distributed +//! across all agents. + +use core::net::SocketAddr; +use std::path::PathBuf; + +pub mod com_init; +pub mod direct; +pub mod relayed; + +/// Node address of a connection +#[derive(Debug, Clone)] +pub enum NodeAddress { + Tcp(SocketAddr), + UnixSocket(PathBuf), +} diff --git a/feo/src/agent/relayed/mod.rs b/src/feo/src/agent/relayed/mod.rs similarity index 58% rename from feo/src/agent/relayed/mod.rs rename to src/feo/src/agent/relayed/mod.rs index 1855be6..8779d30 100644 --- a/feo/src/agent/relayed/mod.rs +++ b/src/feo/src/agent/relayed/mod.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Agent implementation for relayed signalling between scheduler and worker //! diff --git a/feo/src/agent/relayed/primary.rs b/src/feo/src/agent/relayed/primary.rs similarity index 92% rename from feo/src/agent/relayed/primary.rs rename to src/feo/src/agent/relayed/primary.rs index 0ddd270..f26b078 100644 --- a/feo/src/agent/relayed/primary.rs +++ b/src/feo/src/agent/relayed/primary.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Implementation of the primary agent for mixed signalling using sockets and mpsc channels diff --git a/feo/src/agent/relayed/recorder.rs b/src/feo/src/agent/relayed/recorder.rs similarity index 83% rename from feo/src/agent/relayed/recorder.rs rename to src/feo/src/agent/relayed/recorder.rs index 15f6060..6fca433 100644 --- a/feo/src/agent/relayed/recorder.rs +++ b/src/feo/src/agent/relayed/recorder.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Implementation of a recorder for mixed signalling using sockets and mpsc channels diff --git a/feo/src/agent/relayed/secondary.rs b/src/feo/src/agent/relayed/secondary.rs similarity index 87% rename from feo/src/agent/relayed/secondary.rs rename to src/feo/src/agent/relayed/secondary.rs index f9bdc2f..98c4bf4 100644 --- a/feo/src/agent/relayed/secondary.rs +++ b/src/feo/src/agent/relayed/secondary.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Implementation of a secondary agent for mixed signalling using sockets and mpsc channels diff --git a/feo/src/cpp.rs b/src/feo/src/cpp.rs similarity index 87% rename from feo/src/cpp.rs rename to src/feo/src/cpp.rs index 3993e08..c5da5a6 100644 --- a/feo/src/cpp.rs +++ b/src/feo/src/cpp.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Provides a convenience macro creating ffi definitions and Rust glue code for C++ components diff --git a/feo/src/error.rs b/src/feo/src/error.rs similarity index 81% rename from feo/src/error.rs rename to src/feo/src/error.rs index ab87a3d..ce1f44e 100644 --- a/feo/src/error.rs +++ b/src/feo/src/error.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! FEO Error implementation diff --git a/feo/src/ids.rs b/src/feo/src/ids.rs similarity index 86% rename from feo/src/ids.rs rename to src/feo/src/ids.rs index e776154..8c20304 100644 --- a/feo/src/ids.rs +++ b/src/feo/src/ids.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! IDs activities, agents, channels, relays, and workers diff --git a/feo/src/lib.rs b/src/feo/src/lib.rs similarity index 70% rename from feo/src/lib.rs rename to src/feo/src/lib.rs index 8d05f23..682e167 100644 --- a/feo/src/lib.rs +++ b/src/feo/src/lib.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! FEO is an application framework for data- and time-driven applications in the ADAS domain. //! The name is an abbreviation of Fixed Execution Order. diff --git a/src/feo/src/recording/mod.rs b/src/feo/src/recording/mod.rs new file mode 100644 index 0000000..2dd0415 --- /dev/null +++ b/src/feo/src/recording/mod.rs @@ -0,0 +1,21 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +#[cfg(feature = "recording")] +pub mod recorder; + +#[cfg(feature = "recording")] +pub mod registry; + +#[cfg(feature = "recording")] +mod transcoder; diff --git a/feo/src/recording/recorder.rs b/src/feo/src/recording/recorder.rs similarity index 94% rename from feo/src/recording/recorder.rs rename to src/feo/src/recording/recorder.rs index 24a375d..1ff3b1c 100644 --- a/feo/src/recording/recorder.rs +++ b/src/feo/src/recording/recorder.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! FEO data recorder. Records communication for debugging and development purposes diff --git a/feo/src/recording/registry.rs b/src/feo/src/recording/registry.rs similarity index 91% rename from feo/src/recording/registry.rs rename to src/feo/src/recording/registry.rs index 9acd776..01079f9 100644 --- a/feo/src/recording/registry.rs +++ b/src/feo/src/recording/registry.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Type registry use crate::recording::transcoder::{ComRecTranscoderBuilder, RecordingTranscoder}; diff --git a/feo/src/recording/transcoder.rs b/src/feo/src/recording/transcoder.rs similarity index 84% rename from feo/src/recording/transcoder.rs rename to src/feo/src/recording/transcoder.rs index 2abe8cf..d2bdf06 100644 --- a/feo/src/recording/transcoder.rs +++ b/src/feo/src/recording/transcoder.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Transcoders between com layer format and serialization for recording diff --git a/feo/src/scheduler.rs b/src/feo/src/scheduler.rs similarity index 97% rename from feo/src/scheduler.rs rename to src/feo/src/scheduler.rs index 8e39c5d..c49115f 100644 --- a/feo/src/scheduler.rs +++ b/src/feo/src/scheduler.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Global activity scheduler diff --git a/feo/src/signalling/common/interface.rs b/src/feo/src/signalling/common/interface.rs similarity index 82% rename from feo/src/signalling/common/interface.rs rename to src/feo/src/signalling/common/interface.rs index 68eb859..315b358 100644 --- a/feo/src/signalling/common/interface.rs +++ b/src/feo/src/signalling/common/interface.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::ids::{ActivityId, AgentId}; diff --git a/src/feo/src/signalling/common/mod.rs b/src/feo/src/signalling/common/mod.rs new file mode 100644 index 0000000..e3825ea --- /dev/null +++ b/src/feo/src/signalling/common/mod.rs @@ -0,0 +1,19 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Common blocks shared in different signalling layers + +pub(crate) mod interface; +pub(crate) mod mpsc; +pub(crate) mod signals; +pub(crate) mod socket; diff --git a/feo/src/signalling/common/mpsc/endpoint.rs b/src/feo/src/signalling/common/mpsc/endpoint.rs similarity index 92% rename from feo/src/signalling/common/mpsc/endpoint.rs rename to src/feo/src/signalling/common/mpsc/endpoint.rs index dc6c55c..46784d2 100644 --- a/feo/src/signalling/common/mpsc/endpoint.rs +++ b/src/feo/src/signalling/common/mpsc/endpoint.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Basic components for mpsc channel signalling protocol diff --git a/src/feo/src/signalling/common/mpsc/mod.rs b/src/feo/src/signalling/common/mpsc/mod.rs new file mode 100644 index 0000000..5cd3a9b --- /dev/null +++ b/src/feo/src/signalling/common/mpsc/mod.rs @@ -0,0 +1,27 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Mpsc-only signalling module +//! +//! Mpsc-only signalling does not allow for inter-process communication. Therefore +//! it is not applicable for multi-process setups. + +pub(crate) use crate::signalling::common::mpsc::worker::WorkerConnector; +use alloc::boxed::Box; + +pub(crate) mod endpoint; +pub(crate) mod primitives; +pub(crate) mod worker; + +pub type Builder = Box T + Send>; +pub type WorkerConnectorBuilder = Builder; diff --git a/feo/src/signalling/common/mpsc/primitives.rs b/src/feo/src/signalling/common/mpsc/primitives.rs similarity index 72% rename from feo/src/signalling/common/mpsc/primitives.rs rename to src/feo/src/signalling/common/mpsc/primitives.rs index 0e0dc42..61fde73 100644 --- a/feo/src/signalling/common/mpsc/primitives.rs +++ b/src/feo/src/signalling/common/mpsc/primitives.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Primitive building blocks of mpsc channel signalling implementation diff --git a/feo/src/signalling/common/mpsc/worker.rs b/src/feo/src/signalling/common/mpsc/worker.rs similarity index 73% rename from feo/src/signalling/common/mpsc/worker.rs rename to src/feo/src/signalling/common/mpsc/worker.rs index 51bafcf..a39e322 100644 --- a/feo/src/signalling/common/mpsc/worker.rs +++ b/src/feo/src/signalling/common/mpsc/worker.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::signalling::common::interface::ConnectWorker; diff --git a/feo/src/signalling/common/signals.rs b/src/feo/src/signalling/common/signals.rs similarity index 83% rename from feo/src/signalling/common/signals.rs rename to src/feo/src/signalling/common/signals.rs index 29cac15..4ac8743 100644 --- a/feo/src/signalling/common/signals.rs +++ b/src/feo/src/signalling/common/signals.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Signals diff --git a/feo/src/signalling/common/socket/client.rs b/src/feo/src/signalling/common/socket/client.rs similarity index 88% rename from feo/src/signalling/common/socket/client.rs rename to src/feo/src/signalling/common/socket/client.rs index 0c033c3..2cc8b99 100644 --- a/feo/src/signalling/common/socket/client.rs +++ b/src/feo/src/signalling/common/socket/client.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::signalling::common::socket::connection::Connection; diff --git a/feo/src/signalling/common/socket/connection.rs b/src/feo/src/signalling/common/socket/connection.rs similarity index 91% rename from feo/src/signalling/common/socket/connection.rs rename to src/feo/src/signalling/common/socket/connection.rs index 3f9bfc2..da447df 100644 --- a/feo/src/signalling/common/socket/connection.rs +++ b/src/feo/src/signalling/common/socket/connection.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::signalling::common::socket::EncodeDecode; use core::marker::PhantomData; diff --git a/feo/src/signalling/common/socket/mod.rs b/src/feo/src/signalling/common/socket/mod.rs similarity index 96% rename from feo/src/signalling/common/socket/mod.rs rename to src/feo/src/signalling/common/socket/mod.rs index 87ac514..5ef063a 100644 --- a/feo/src/signalling/common/socket/mod.rs +++ b/src/feo/src/signalling/common/socket/mod.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Socket signalling building blocks diff --git a/feo/src/signalling/common/socket/server.rs b/src/feo/src/signalling/common/socket/server.rs similarity index 92% rename from feo/src/signalling/common/socket/server.rs rename to src/feo/src/signalling/common/socket/server.rs index 183674d..d1ae0fa 100644 --- a/feo/src/signalling/common/socket/server.rs +++ b/src/feo/src/signalling/common/socket/server.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::signalling::common::socket::connection::Connection; use crate::signalling::common::socket::{EncodeDecode, ProtocolSignal}; diff --git a/src/feo/src/signalling/direct/mod.rs b/src/feo/src/signalling/direct/mod.rs new file mode 100644 index 0000000..c01fe62 --- /dev/null +++ b/src/feo/src/signalling/direct/mod.rs @@ -0,0 +1,25 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Signalling layer with direct connection between scheduler and workers +//! +//! This module provides connector implementations which establish direct connections +//! between the scheduler and every worker. +//! The layer does not differentiate between connecting workers in other processes +//! or in the same process as the scheduler. + +pub(crate) mod mpsc; +#[cfg(feature = "recording")] +pub(crate) mod recorder; +pub(crate) mod scheduler; +pub(crate) mod worker; diff --git a/src/feo/src/signalling/direct/mpsc/mod.rs b/src/feo/src/signalling/direct/mpsc/mod.rs new file mode 100644 index 0000000..13b5afc --- /dev/null +++ b/src/feo/src/signalling/direct/mpsc/mod.rs @@ -0,0 +1,16 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Elements for mpsc-based signalling + +pub(crate) mod scheduler; diff --git a/feo/src/signalling/direct/mpsc/scheduler.rs b/src/feo/src/signalling/direct/mpsc/scheduler.rs similarity index 91% rename from feo/src/signalling/direct/mpsc/scheduler.rs rename to src/feo/src/signalling/direct/mpsc/scheduler.rs index 7370af3..e0d9d3f 100644 --- a/feo/src/signalling/direct/mpsc/scheduler.rs +++ b/src/feo/src/signalling/direct/mpsc/scheduler.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::ids::{ActivityId, AgentId, ChannelId, WorkerId}; diff --git a/feo/src/signalling/direct/recorder.rs b/src/feo/src/signalling/direct/recorder.rs similarity index 87% rename from feo/src/signalling/direct/recorder.rs rename to src/feo/src/signalling/direct/recorder.rs index 84a2abd..bb09de7 100644 --- a/feo/src/signalling/direct/recorder.rs +++ b/src/feo/src/signalling/direct/recorder.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::ids::AgentId; diff --git a/feo/src/signalling/direct/scheduler.rs b/src/feo/src/signalling/direct/scheduler.rs similarity index 93% rename from feo/src/signalling/direct/scheduler.rs rename to src/feo/src/signalling/direct/scheduler.rs index 991589b..f0cfaa3 100644 --- a/feo/src/signalling/direct/scheduler.rs +++ b/src/feo/src/signalling/direct/scheduler.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::ids::{ActivityId, AgentId}; diff --git a/feo/src/signalling/direct/worker.rs b/src/feo/src/signalling/direct/worker.rs similarity index 87% rename from feo/src/signalling/direct/worker.rs rename to src/feo/src/signalling/direct/worker.rs index 729e31e..fa41dc1 100644 --- a/feo/src/signalling/direct/worker.rs +++ b/src/feo/src/signalling/direct/worker.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::ids::ActivityId; diff --git a/src/feo/src/signalling/mod.rs b/src/feo/src/signalling/mod.rs new file mode 100644 index 0000000..3b2c887 --- /dev/null +++ b/src/feo/src/signalling/mod.rs @@ -0,0 +1,20 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Signalling module +//! +//! This module defines interfaces and implementation variants for signalling. + +pub(crate) mod common; +pub(crate) mod direct; +pub(crate) mod relayed; diff --git a/src/feo/src/signalling/relayed/connectors/mod.rs b/src/feo/src/signalling/relayed/connectors/mod.rs new file mode 100644 index 0000000..92a7aa1 --- /dev/null +++ b/src/feo/src/signalling/relayed/connectors/mod.rs @@ -0,0 +1,20 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Signalling connectors and relays for various feo components + +#[cfg(feature = "recording")] +pub(crate) mod recorder; +pub(crate) mod relays; +pub(crate) mod scheduler; +pub(crate) mod secondary; diff --git a/feo/src/signalling/relayed/connectors/recorder.rs b/src/feo/src/signalling/relayed/connectors/recorder.rs similarity index 76% rename from feo/src/signalling/relayed/connectors/recorder.rs rename to src/feo/src/signalling/relayed/connectors/recorder.rs index 182c7e0..d560ffc 100644 --- a/feo/src/signalling/relayed/connectors/recorder.rs +++ b/src/feo/src/signalling/relayed/connectors/recorder.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::signalling::common::interface::ConnectRecorder; diff --git a/feo/src/signalling/relayed/connectors/relays.rs b/src/feo/src/signalling/relayed/connectors/relays.rs similarity index 96% rename from feo/src/signalling/relayed/connectors/relays.rs rename to src/feo/src/signalling/relayed/connectors/relays.rs index a168cc4..2961825 100644 --- a/feo/src/signalling/relayed/connectors/relays.rs +++ b/src/feo/src/signalling/relayed/connectors/relays.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Relays transferring signals between intra- and inter-process channels diff --git a/feo/src/signalling/relayed/connectors/scheduler.rs b/src/feo/src/signalling/relayed/connectors/scheduler.rs similarity index 91% rename from feo/src/signalling/relayed/connectors/scheduler.rs rename to src/feo/src/signalling/relayed/connectors/scheduler.rs index 1070c1c..6ded8ec 100644 --- a/feo/src/signalling/relayed/connectors/scheduler.rs +++ b/src/feo/src/signalling/relayed/connectors/scheduler.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::ids::{ActivityId, AgentId, ChannelId, WorkerId}; diff --git a/feo/src/signalling/relayed/connectors/secondary.rs b/src/feo/src/signalling/relayed/connectors/secondary.rs similarity index 70% rename from feo/src/signalling/relayed/connectors/secondary.rs rename to src/feo/src/signalling/relayed/connectors/secondary.rs index 6fc2366..a3356e2 100644 --- a/feo/src/signalling/relayed/connectors/secondary.rs +++ b/src/feo/src/signalling/relayed/connectors/secondary.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::signalling::relayed::connectors::relays::{SecondaryReceiveRelay, SecondarySendRelay}; use crate::signalling::relayed::interface::IsChannel; diff --git a/feo/src/signalling/relayed/interface.rs b/src/feo/src/signalling/relayed/interface.rs similarity index 77% rename from feo/src/signalling/relayed/interface.rs rename to src/feo/src/signalling/relayed/interface.rs index ded9e09..d1bbc15 100644 --- a/feo/src/signalling/relayed/interface.rs +++ b/src/feo/src/signalling/relayed/interface.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::error::Error; use crate::ids::ChannelId; diff --git a/feo/src/signalling/relayed/mod.rs b/src/feo/src/signalling/relayed/mod.rs similarity index 62% rename from feo/src/signalling/relayed/mod.rs rename to src/feo/src/signalling/relayed/mod.rs index e631580..1b8f54f 100644 --- a/feo/src/signalling/relayed/mod.rs +++ b/src/feo/src/signalling/relayed/mod.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Relayed signalling module //! diff --git a/feo/src/signalling/relayed/mpsc/endpoint.rs b/src/feo/src/signalling/relayed/mpsc/endpoint.rs similarity index 81% rename from feo/src/signalling/relayed/mpsc/endpoint.rs rename to src/feo/src/signalling/relayed/mpsc/endpoint.rs index bc0586b..99798b4 100644 --- a/feo/src/signalling/relayed/mpsc/endpoint.rs +++ b/src/feo/src/signalling/relayed/mpsc/endpoint.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Communication endpoints for mpsc-based signalling diff --git a/src/feo/src/signalling/relayed/mpsc/mod.rs b/src/feo/src/signalling/relayed/mpsc/mod.rs new file mode 100644 index 0000000..6cffa15 --- /dev/null +++ b/src/feo/src/signalling/relayed/mpsc/mod.rs @@ -0,0 +1,16 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Elements for mpsc-based signalling + +pub(crate) mod endpoint; diff --git a/feo/src/signalling/relayed/sockets/endpoint.rs b/src/feo/src/signalling/relayed/sockets/endpoint.rs similarity index 95% rename from feo/src/signalling/relayed/sockets/endpoint.rs rename to src/feo/src/signalling/relayed/sockets/endpoint.rs index 1c6047f..b9d0699 100644 --- a/feo/src/signalling/relayed/sockets/endpoint.rs +++ b/src/feo/src/signalling/relayed/sockets/endpoint.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Communication endpoints for socket-based signalling diff --git a/src/feo/src/signalling/relayed/sockets/mod.rs b/src/feo/src/signalling/relayed/sockets/mod.rs new file mode 100644 index 0000000..8562eb9 --- /dev/null +++ b/src/feo/src/signalling/relayed/sockets/mod.rs @@ -0,0 +1,16 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Elements for socket-based signalling + +pub(crate) mod endpoint; diff --git a/feo/src/signalling/relayed/sockets_mpsc.rs b/src/feo/src/signalling/relayed/sockets_mpsc.rs similarity index 97% rename from feo/src/signalling/relayed/sockets_mpsc.rs rename to src/feo/src/signalling/relayed/sockets_mpsc.rs index a5755c8..e5c202d 100644 --- a/feo/src/signalling/relayed/sockets_mpsc.rs +++ b/src/feo/src/signalling/relayed/sockets_mpsc.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Connectors for relayed signalling using sockets and mpsc channels //! diff --git a/feo/src/timestamp.rs b/src/feo/src/timestamp.rs similarity index 92% rename from feo/src/timestamp.rs rename to src/feo/src/timestamp.rs index eef7363..c097593 100644 --- a/feo/src/timestamp.rs +++ b/src/feo/src/timestamp.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Timestamping module @@ -146,7 +146,7 @@ pub struct SyncInfo { since_epoch: core::time::Duration, } -/// Return current system time and instant as a TimeInfo object +/// Return current system time and instant as a TimeInfo object fn time_info_now() -> TimeInfo { let mut tries_remaining: i32 = MAX_TRIES; loop { diff --git a/feo/src/topicspec.rs b/src/feo/src/topicspec.rs similarity index 73% rename from feo/src/topicspec.rs rename to src/feo/src/topicspec.rs index 04e96e3..b99def2 100644 --- a/feo/src/topicspec.rs +++ b/src/feo/src/topicspec.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Specification of a topic's peers and init function diff --git a/feo/src/worker/mod.rs b/src/feo/src/worker/mod.rs similarity index 91% rename from feo/src/worker/mod.rs rename to src/feo/src/worker/mod.rs index 4b19f7e..adf3a5e 100644 --- a/feo/src/worker/mod.rs +++ b/src/feo/src/worker/mod.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Worker thread running FEO activities diff --git a/src/feo/tests/smoke.rs b/src/feo/tests/smoke.rs new file mode 100644 index 0000000..3e36417 --- /dev/null +++ b/src/feo/tests/smoke.rs @@ -0,0 +1,16 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +/// Empty smoke test to make sure the tests are running +#[test] +fn smoke() {} diff --git a/logd/BUILD.bazel b/src/logd/BUILD.bazel similarity index 88% rename from logd/BUILD.bazel rename to src/logd/BUILD.bazel index 8321ca9..fdecd88 100644 --- a/logd/BUILD.bazel +++ b/src/logd/BUILD.bazel @@ -22,8 +22,8 @@ rust_binary( visibility = ["//visibility:public"], deps = [ ":liblogd", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", "@score_crates//:anyhow", "@score_crates//:tokio", ], @@ -38,8 +38,8 @@ rust_library( crate_name = "logd", visibility = ["//visibility:public"], deps = [ - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", "@score_crates//:anyhow", "@score_crates//:async_stream", "@score_crates//:bytes", diff --git a/logd/Cargo.toml b/src/logd/Cargo.toml similarity index 100% rename from logd/Cargo.toml rename to src/logd/Cargo.toml diff --git a/logd/examples/client_packet.rs b/src/logd/examples/client_packet.rs similarity index 64% rename from logd/examples/client_packet.rs rename to src/logd/examples/client_packet.rs index ca978d7..2335644 100644 --- a/logd/examples/client_packet.rs +++ b/src/logd/examples/client_packet.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Connect to logd and send a log record every second via seqpackets. diff --git a/logd/examples/client_stream.rs b/src/logd/examples/client_stream.rs similarity index 61% rename from logd/examples/client_stream.rs rename to src/logd/examples/client_stream.rs index d481425..c023d0e 100644 --- a/logd/examples/client_stream.rs +++ b/src/logd/examples/client_stream.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! This example demonstrates how to send log records to the logd daemon using a Unix stream socket. diff --git a/logd/src/input.rs b/src/logd/src/input.rs similarity index 88% rename from logd/src/input.rs rename to src/logd/src/input.rs index 08775c9..8a3376a 100644 --- a/logd/src/input.rs +++ b/src/logd/src/input.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* use crate::{RecordSender, MAX_RECORD_SIZE, UNIX_PACKET_PATH, UNIX_STREAM_PATH}; use anyhow::{Context, Error}; diff --git a/logd/src/lib.rs b/src/logd/src/lib.rs similarity index 71% rename from logd/src/lib.rs rename to src/logd/src/lib.rs index 7a55ae0..0e9ee06 100644 --- a/logd/src/lib.rs +++ b/src/logd/src/lib.rs @@ -1,15 +1,15 @@ -/******************************************************************************** - * Copyright (c) 2025 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* //! Central trace collector diff --git a/src/logd/src/main.rs b/src/logd/src/main.rs new file mode 100644 index 0000000..5c83a65 --- /dev/null +++ b/src/logd/src/main.rs @@ -0,0 +1,32 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +//! Placeholder logging daemon that collects logs from various sources. Minimal effort implementation. + +use anyhow::Error; +use feo_log::{info, LevelFilter}; +use tokio::runtime; + +fn main() -> Result<(), Error> { + // Initialize the logger *without* the logd part logger. + feo_logger::init(LevelFilter::Debug, true, false); + + info!("Starting logd"); + + let logd = logd::run(); + + runtime::Builder::new_current_thread() + .enable_io() + .build()? + .block_on(logd) +} diff --git a/perfetto-model/BUILD.bazel b/src/perfetto-model/BUILD.bazel similarity index 100% rename from perfetto-model/BUILD.bazel rename to src/perfetto-model/BUILD.bazel diff --git a/perfetto-model/Cargo.toml b/src/perfetto-model/Cargo.toml similarity index 100% rename from perfetto-model/Cargo.toml rename to src/perfetto-model/Cargo.toml diff --git a/perfetto-model/LICENSE b/src/perfetto-model/LICENSE similarity index 100% rename from perfetto-model/LICENSE rename to src/perfetto-model/LICENSE diff --git a/perfetto-model/README.md b/src/perfetto-model/README.md similarity index 100% rename from perfetto-model/README.md rename to src/perfetto-model/README.md diff --git a/src/perfetto-model/build.rs b/src/perfetto-model/build.rs new file mode 100644 index 0000000..f436844 --- /dev/null +++ b/src/perfetto-model/build.rs @@ -0,0 +1,16 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* + +fn main() -> std::io::Result<()> { + prost_build::compile_protos(&["protos/perfetto_trace.proto"], &["protos"]).map(drop) +} diff --git a/perfetto-model/protos/perfetto_trace.proto b/src/perfetto-model/protos/perfetto_trace.proto similarity index 100% rename from perfetto-model/protos/perfetto_trace.proto rename to src/perfetto-model/protos/perfetto_trace.proto diff --git a/src/perfetto-model/src/lib.rs b/src/perfetto-model/src/lib.rs new file mode 100644 index 0000000..338dbb9 --- /dev/null +++ b/src/perfetto-model/src/lib.rs @@ -0,0 +1,13 @@ +// ******************************************************************************* +// Copyright (c) 2025 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache License Version 2.0 which is available at +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* +pub use perfetto_proto::perfetto::protos::*; diff --git a/tests/rust/feo_tests/test_agent/BUILD b/tests/rust/feo_tests/test_agent/BUILD index 255b2e4..68f1c5e 100644 --- a/tests/rust/feo_tests/test_agent/BUILD +++ b/tests/rust/feo_tests/test_agent/BUILD @@ -34,12 +34,12 @@ rust_binary( ], visibility = ["//visibility:public"], deps = [ - "//feo:libfeo_rust", - "//feo-com:libfeo_com_rust", - "//feo-log:libfeo_log_rust", - "//feo-logger:libfeo_logger_rust", - "//feo-time:libfeo_time_rust", - "//feo-tracing:libfeo_tracing_rust", + "//src/feo:libfeo_rust", + "//src/feo-com:libfeo_com_rust", + "//src/feo-log:libfeo_log_rust", + "//src/feo-logger:libfeo_logger_rust", + "//src/feo-time:libfeo_time_rust", + "//src/feo-tracing:libfeo_tracing_rust", "@score_crates//:clap", "@score_crates//:ipc_channel", "@score_crates//:libc",