agent: remove instrument attribute for some simple functions

For some simple functions that only process memory data(list/hashmap),
they don't need to be instrumented.

And sometime they may generate non-parent spans, if they are called from
daemon-style "threads".

Fixes: #1968

Signed-off-by: bin <bin@hyper.sh>
This commit is contained in:
bin 2021-06-11 09:45:30 +08:00
parent cfb8139f36
commit 65d2fb5d11

View File

@ -181,7 +181,6 @@ impl Sandbox {
Ok(true)
}
#[instrument]
pub fn add_container(&mut self, c: LinuxContainer) {
self.containers.insert(c.id.clone(), c);
}
@ -210,12 +209,10 @@ impl Sandbox {
Ok(())
}
#[instrument]
pub fn get_container(&mut self, id: &str) -> Option<&mut LinuxContainer> {
self.containers.get_mut(id)
}
#[instrument]
pub fn find_process(&mut self, pid: pid_t) -> Option<&mut Process> {
for (_, c) in self.containers.iter_mut() {
if c.processes.get(&pid).is_some() {