We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 972ca6c commit 8df5b6cCopy full SHA for 8df5b6c
frame-analyzer/src/lib.rs
@@ -158,6 +158,7 @@ impl Analyzer {
158
}
159
160
/// Attach the Analyzer to the target application
161
+ /// If attach the same application multiple times, `Analyzer::attach_app` will directly return `Ok` without attaching again
162
///
163
/// # Errors
164
@@ -184,6 +185,10 @@ impl Analyzer {
184
185
/// # }
186
/// ```
187
pub fn attach_app(&mut self, pid: Pid) -> Result<()> {
188
+ if self.contains(pid) {
189
+ return Ok(());
190
+ }
191
+
192
let mut uprobe = UprobeHandler::attach_app(pid)?;
193
194
self.poll.registry().register(
0 commit comments