Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only do per-frame-blocklist-check when frame-pointer is enabled #172

Merged
merged 2 commits into from
Nov 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use smallvec::SmallVec;
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
use findshlibs::{Segment, SharedLibrary, TargetSharedLibrary};

use crate::backtrace::{Frame, Trace, TraceImpl};
use crate::backtrace::{Trace, TraceImpl};
use crate::collector::Collector;
use crate::error::{Error, Result};
use crate::frames::UnresolvedFrames;
Expand Down Expand Up @@ -288,9 +288,12 @@ extern "C" fn perf_signal_handler(

let sample_timestamp: SystemTime = SystemTime::now();
TraceImpl::trace(ucontext, |frame| {
let ip = Frame::ip(frame);
if profiler.is_blocklisted(ip) {
return false;
#[cfg(feature = "frame-pointer")]
{
let ip = crate::backtrace::Frame::ip(frame);
if profiler.is_blocklisted(ip) {
return false;
}
}

if index < MAX_DEPTH {
Expand Down