Skip to content

Commit

Permalink
Fixed some warnings
Browse files Browse the repository at this point in the history
igned-off-by: Benedikt Zinn <[email protected]>
  • Loading branch information
BenediktZinn committed Jan 14, 2025
1 parent ca92d1b commit 9f6d666
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion rust/backend/daemon/src/collector/event_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ impl EventDispatcherState {


impl Actor for EventDispatcher {
type Arguments = EventDispatcherState;
type Msg = Event;
type State = EventDispatcherState;
type Arguments = EventDispatcherState;

async fn pre_start(
&self,
Expand Down
2 changes: 1 addition & 1 deletion rust/backend/daemon/src/collector/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ impl CollectorSupervisorArguments {
}

impl Actor for CollectorSupervisor {
type Arguments = CollectorSupervisorArguments;
type Msg = ();
type State = CollectorSupervisorState;
type Arguments = CollectorSupervisorArguments;

async fn pre_start(
&self,
Expand Down
34 changes: 17 additions & 17 deletions rust/backend/daemon/src/symbols/actors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ unsafe impl<S> Sync for SymbolFilePathCollector<S> where S: Stream + State {}

impl<S> Actor for SymbolFilePathCollector<S>
where S: Stream<Item = SymbolFilePath> + State + Unpin {
type Arguments = (S, ActorRef<SymbolFilePath>);
type State = (S, ActorRef<SymbolFilePath>);
type Msg = ();
type State = (S, ActorRef<SymbolFilePath>);
type Arguments = (S, ActorRef<SymbolFilePath>);

async fn pre_start(
&self,
Expand Down Expand Up @@ -54,16 +54,16 @@ where S: Stream<Item = SymbolFilePath> + State + Unpin {
struct SymbolFileParserProxy;

impl Actor for SymbolFileParserProxy {
type Arguments = (usize, ActorCell, ActorRef<SymbolWithPath>);
type State = ActorRef<FactoryMessage<(), SymbolFilePath>>;
type Msg = SymbolFilePath;
type State = ActorRef<FactoryMessage<(), SymbolFilePath>>;
type Arguments = (usize, ActorCell, ActorRef<SymbolWithPath>);

async fn pre_start(
&self,
_: ActorRef<Self::Msg>,
args: Self::Arguments,
) -> Result<Self::State, ActorProcessingErr> {
let factory_def = Factory::<(), SymbolFilePath, ActorRef<SymbolWithPath>, SymbolFileParser, QueuerRouting<(), SymbolFilePath>, DefaultQueue::<(), SymbolFilePath>>::default();
let factory_def = Factory::<(), SymbolFilePath, ActorRef<SymbolWithPath>, SymbolFileParser, QueuerRouting<(), SymbolFilePath>, DefaultQueue<(), SymbolFilePath>>::default();
let factory_args = FactoryArguments::builder()
.num_initial_workers(args.0)
.worker_builder(Box::new(SymbolFileParserBuilder(args.2.clone())))
Expand All @@ -75,22 +75,22 @@ impl Actor for SymbolFileParserProxy {

Ok(actor_ref)
}
async fn handle(

async fn post_stop(
&self,
_: ActorRef<Self::Msg>,
message: Self::Msg,
state: &mut Self::State,
) -> Result<(), ActorProcessingErr> {
Ok(cast!(state, FactoryMessage::Dispatch(Job { key: (), accepted: None, msg: message, options: JobOptions::default() }))?)
Ok(cast!(state, FactoryMessage::DrainRequests)?)
}
async fn post_stop(

async fn handle(
&self,
_: ActorRef<Self::Msg>,
message: Self::Msg,
state: &mut Self::State,
) -> Result<(), ActorProcessingErr> {
Ok(cast!(state, FactoryMessage::DrainRequests)?)
Ok(cast!(state, FactoryMessage::Dispatch(Job { key: (), accepted: None, msg: message, options: JobOptions::default() }))?)
}

async fn handle_supervisor_evt(
Expand Down Expand Up @@ -122,9 +122,9 @@ impl WorkerBuilder<SymbolFileParser, ActorRef<SymbolWithPath>> for SymbolFilePar
struct SymbolFileParser;

impl Actor for SymbolFileParser {
type Arguments = WorkerStartContext<(), SymbolFilePath, ActorRef<SymbolWithPath>>;
type State = WorkerStartContext<(), SymbolFilePath, ActorRef<SymbolWithPath>>;
type Msg = WorkerMessage<(), SymbolFilePath>;
type State = WorkerStartContext<(), SymbolFilePath, ActorRef<SymbolWithPath>>;
type Arguments = WorkerStartContext<(), SymbolFilePath, ActorRef<SymbolWithPath>>;

async fn pre_start(
&self,
Expand Down Expand Up @@ -167,9 +167,9 @@ impl Actor for SymbolFileParser {
struct SymbolIndexer;

impl Actor for SymbolIndexer {
type Arguments = Arc<IndexWriter>;
type State = (Field, Field, Field, Field, Arc<IndexWriter>);
type Msg = SymbolWithPath;
type State = (Field, Field, Field, Field, Arc<IndexWriter>);
type Arguments = Arc<IndexWriter>;

async fn pre_start(
&self,
Expand Down Expand Up @@ -240,8 +240,8 @@ pub enum SymbolActorMsg {

impl Actor for SymbolActor {
type Msg = SymbolActorMsg;
type Arguments = ();
type State = Index;
type Arguments = ();

async fn pre_start(
&self,
Expand Down
10 changes: 6 additions & 4 deletions rust/backend/ebpf-test/tests/prog_test_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ fn prog_test_run_example() {
let args = [0u64, 0u64, target_pid, signal];

let mut attr = unsafe { mem::zeroed::<bpf_attr>() };

attr.test.prog_fd = fd as u32;
attr.test.ctx_in = args.as_ptr() as u64;
attr.test.ctx_size_in = args.len() as u32 * 8;

unsafe {
attr.test.prog_fd = fd as u32;
attr.test.ctx_in = args.as_ptr() as u64;
attr.test.ctx_size_in = args.len() as u32 * 8;
}

let _ = {
let ret = unsafe { syscall(SYS_bpf, bpf_cmd::BPF_PROG_TEST_RUN, &mut attr, size_of::<bpf_attr>()) };
Expand Down

0 comments on commit 9f6d666

Please sign in to comment.