Skip to content

Commit 19ea85c

Browse files
chore: bump instrument-hooks submodule to include stubs improvement
Fixes compilation warnings in exec-harness's build script.
1 parent ed90646 commit 19ea85c

3 files changed

Lines changed: 31 additions & 7 deletions

File tree

crates/instrument-hooks-bindings/src/bindings.rs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ pub const MARKER_TYPE_SAMPLE_START: u32 = 0;
44
pub const MARKER_TYPE_SAMPLE_END: u32 = 1;
55
pub const MARKER_TYPE_BENCHMARK_START: u32 = 2;
66
pub const MARKER_TYPE_BENCHMARK_END: u32 = 3;
7-
pub type InstrumentHooks = *mut u64;
7+
#[repr(C)]
8+
#[derive(Debug, Copy, Clone)]
9+
pub struct InstrumentHooks {
10+
_unused: [u8; 0],
11+
}
812
unsafe extern "C" {
913
pub fn instrument_hooks_init() -> *mut InstrumentHooks;
1014
}
@@ -44,7 +48,7 @@ unsafe extern "C" {
4448
unsafe extern "C" {
4549
pub fn instrument_hooks_add_marker(
4650
arg1: *mut InstrumentHooks,
47-
pid: u32,
51+
pid: i32,
4852
marker_type: u8,
4953
timestamp: u64,
5054
) -> u8;
@@ -56,5 +60,25 @@ pub const instrument_hooks_feature_t_FEATURE_DISABLE_CALLGRIND_MARKERS: instrume
5660
0;
5761
pub type instrument_hooks_feature_t = ::std::os::raw::c_uint;
5862
unsafe extern "C" {
59-
pub fn instrument_hooks_set_feature(feature: instrument_hooks_feature_t, enabled: bool);
63+
pub fn instrument_hooks_set_feature(feature: u64, enabled: bool);
64+
}
65+
unsafe extern "C" {
66+
pub fn instrument_hooks_set_environment(
67+
arg1: *mut InstrumentHooks,
68+
section_name: *const ::std::os::raw::c_char,
69+
key: *const ::std::os::raw::c_char,
70+
value: *const ::std::os::raw::c_char,
71+
) -> u8;
72+
}
73+
unsafe extern "C" {
74+
pub fn instrument_hooks_set_environment_list(
75+
arg1: *mut InstrumentHooks,
76+
section_name: *const ::std::os::raw::c_char,
77+
key: *const ::std::os::raw::c_char,
78+
values: *const *const ::std::os::raw::c_char,
79+
count: u32,
80+
) -> u8;
81+
}
82+
unsafe extern "C" {
83+
pub fn instrument_hooks_write_environment(arg1: *mut InstrumentHooks, pid: i32) -> u8;
6084
}

crates/instrument-hooks-bindings/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ mod linux_impl {
7878

7979
#[inline(always)]
8080
pub fn add_benchmark_timestamps(&self, start: u64, end: u64) {
81-
let pid = std::process::id();
81+
let pid = std::process::id() as i32;
8282

8383
unsafe {
8484
ffi::instrument_hooks_add_marker(
@@ -100,7 +100,7 @@ mod linux_impl {
100100

101101
#[inline(always)]
102102
pub fn add_sample_timestamps(&self, start: u64, end: u64) {
103-
let pid = std::process::id();
103+
let pid = std::process::id() as i32;
104104

105105
unsafe {
106106
ffi::instrument_hooks_add_marker(
@@ -141,7 +141,7 @@ mod linux_impl {
141141
pub fn disable_callgrind_markers() {
142142
unsafe {
143143
ffi::instrument_hooks_set_feature(
144-
ffi::instrument_hooks_feature_t_FEATURE_DISABLE_CALLGRIND_MARKERS,
144+
ffi::instrument_hooks_feature_t_FEATURE_DISABLE_CALLGRIND_MARKERS.into(),
145145
true,
146146
)
147147
};

0 commit comments

Comments
 (0)