Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions .github/workflows/build-dev-auto-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v2
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
override: true
toolchain: 1.85
components: rustfmt, clippy

- name: Show environment information
shell: bash
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v2
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
override: true
toolchain: 1.85
components: rustfmt, clippy

- name: Show environment information
shell: bash
Expand Down
1 change: 1 addition & 0 deletions src/perf_event/sampling/group/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ impl Inner {
regs_user_len: perf_event_attr.sample_regs_user.count_ones() as _,
#[cfg(feature = "linux-3.19")]
regs_intr_len: perf_event_attr.sample_regs_intr.count_ones() as _,
perf_event_attr: perf_event_attr.0,
};

let event_id = member.event_id()?;
Expand Down
11 changes: 9 additions & 2 deletions src/perf_event/sampling/single/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ use memmap2::{MmapMut, MmapOptions};
pub use stat::SamplerStat;

use crate::{
config,
config::{Cpu, Error, Process},
config::{self, Cpu, Error, Process},
infra::WrapResult,
sampling::{
record::*,
single::{next_record::next_record, stat::sampler_stat},
Config,
},
syscall::{bindings::*, ioctl_wrapped, perf_event_open_wrapped},
RawPerfEventAttr,
};

pub struct Sampler {
Expand All @@ -64,6 +64,8 @@ pub struct Sampler {
pub(crate) regs_user_len: usize,
#[cfg(feature = "linux-3.19")]
pub(crate) regs_intr_len: usize,

pub(crate) perf_event_attr: RawPerfEventAttr,
}

impl Sampler {
Expand Down Expand Up @@ -102,6 +104,7 @@ impl Sampler {
regs_user_len: perf_event_attr.sample_regs_user.count_ones() as _,
#[cfg(feature = "linux-3.19")]
regs_intr_len: perf_event_attr.sample_regs_intr.count_ones() as _,
perf_event_attr: perf_event_attr.0,
}
.wrap_ok()
}
Expand Down Expand Up @@ -156,4 +159,8 @@ impl Sampler {
pub fn get_raw_fd(&self) -> i32 {
self.file.as_raw_fd()
}

pub fn perf_event_attr(&self) -> perf_event_attr {
self.perf_event_attr
}
}
1 change: 1 addition & 0 deletions src/perf_event/tracing/tracer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl Tracer {
regs_user_len: perf_event_attr.sample_regs_user.count_ones() as _,
#[cfg(feature = "linux-3.19")]
regs_intr_len: perf_event_attr.sample_regs_intr.count_ones() as _,
perf_event_attr: perf_event_attr.0,
};

Ok(Self { sampler })
Expand Down
Loading