• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use super::OnItem;
2 use anyhow::Result;
3 use log::debug;
4 use uprobestats_bpf_bindgen::MalwareSignal;
5 use uprobestats_proto::config::uprobestats_config::Task;
6 
7 // SAFETY: `MalwareSignal` is a struct defined in the given `MAP_PATH`, and is guaranteed to match the
8 // layout of the corresponding C struct.
9 unsafe impl OnItem for MalwareSignal {
10     const MAP_PATH: &'static str = "/sys/fs/bpf/uprobestats/map_MalwareSignal_output_buf";
on_item(&self, _task: &Task) -> Result<()>11     fn on_item(&self, _task: &Task) -> Result<()> {
12         if self.wm_bound_uid.initialized {
13             debug!("wm_bound_uid: {:?}", self.wm_bound_uid);
14         }
15         if self.component_enabled_setting.initialized {
16             debug!("component_enabled_setting: {:?}", self.component_enabled_setting);
17         }
18         Ok(())
19     }
20 }
21