Skip to content

Commit

Permalink
Only do per-frame-blocklist-check when frame-pointer is enabled (#172)
Browse files Browse the repository at this point in the history
* Only do perf-frame-blocklist-check when frame-pointer is enabled

Signed-off-by: mornyx <mornyx.z@gmail.com>

* Clippy

Signed-off-by: mornyx <mornyx.z@gmail.com>

Signed-off-by: mornyx <mornyx.z@gmail.com>
  • Loading branch information
mornyx committed Nov 3, 2022
1 parent 059d3c8 commit 09c0e73
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/profiler.rs
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

0 comments on commit 09c0e73

Please sign in to comment.