Skip to content

Commit d10f1fa

Browse files
committed
fix
1 parent 82db5dc commit d10f1fa

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

frame-analyzer/src/uprobe.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919
use aya::{
20+
Ebpf,
2021
maps::{MapData, RingBuf},
2122
programs::UProbe,
22-
Ebpf,
2323
};
2424

2525
use crate::{ebpf::load_bpf, error::Result};
@@ -47,12 +47,14 @@ impl UprobeHandler {
4747
0,
4848
"/system/lib64/libgui.so",
4949
Some(pid),
50-
).unwrap_or_else(|_| program.attach(
51-
Some("_ZN7android7Surface11queueBufferEP19ANativeWindowBufferiPNS_24SurfaceQueueBufferOutputE"),
52-
0,
53-
"/system/lib64/libgui.so",
54-
Some(pid),
55-
)?);
50+
).or_else(|e1| {
51+
program.attach(
52+
Some("_ZN7android7Surface11queueBufferEP19ANativeWindowBufferiPNS_24SurfaceQueueBufferOutputE"),
53+
0,
54+
"/system/lib64/libgui.so",
55+
Some(pid),
56+
)
57+
})?;
5658

5759
Ok(Self { bpf })
5860
}

0 commit comments

Comments
 (0)