Skip to content

Commit

Permalink
Merge pull request rust-lang#219 from kamalmarhubi/perf_event_open
Browse files Browse the repository at this point in the history
linux: Add SYS_perf_event_open syscall numbers
  • Loading branch information
alexcrichton committed Mar 11, 2016
2 parents 04213bb + a63cd45 commit 8a4e72e
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/musl/b32/arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,4 @@ pub const FIONREAD: ::c_ulong = 0x541B;
pub const TIOCCONS: ::c_ulong = 0x541D;

pub const SYS_gettid: ::c_long = 224;
pub const SYS_perf_event_open: ::c_long = 364;
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/musl/b32/mips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,4 @@ pub const FIONREAD: ::c_ulong = 0x467F;
pub const TIOCCONS: ::c_ulong = 0x80047478;

pub const SYS_gettid: ::c_long = 4222; // Valid for O32
pub const SYS_perf_event_open: ::c_long = 4333; // Valid for O32
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/musl/b32/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,4 @@ pub const FIONREAD: ::c_ulong = 0x541B;
pub const TIOCCONS: ::c_ulong = 0x541D;

pub const SYS_gettid: ::c_long = 224;
pub const SYS_perf_event_open: ::c_long = 336;
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/musl/b64/aarch64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub const SYS_perf_event_open: ::c_long = 241;
15 changes: 14 additions & 1 deletion src/unix/notbsd/linux/musl/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,17 @@ pub const TIOCMSET: ::c_ulong = 0x5418;
pub const FIONREAD: ::c_ulong = 0x541B;
pub const TIOCCONS: ::c_ulong = 0x541D;

pub const SYS_gettid: ::c_long = 186; // Valid for x86_64
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(any(target_arch = "powerpc64"))] {
mod powerpc64;
pub use self::powerpc64::*;
} else if #[cfg(any(target_arch = "x86_64"))] {
mod x86_64;
pub use self::x86_64::*;
} else {
// Unknown target_arch
}
}
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/musl/b64/powerpc64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub const SYS_perf_event_open: ::c_long = 319;
3 changes: 3 additions & 0 deletions src/unix/notbsd/linux/musl/b64/x86_64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub const SYS_gettid: ::c_long = 186;

pub const SYS_perf_event_open: ::c_long = 298;
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b32/arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ pub const FIOCLEX: ::c_ulong = 0x5451;
pub const FIONBIO: ::c_ulong = 0x5421;

pub const SYS_gettid: ::c_long = 224;
pub const SYS_perf_event_open: ::c_long = 364;
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ pub const FIOCLEX: ::c_ulong = 0x20006601;
pub const FIONBIO: ::c_ulong = 0x8004667e;

pub const SYS_gettid: ::c_long = 207;
pub const SYS_perf_event_open: ::c_long = 319;
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b32/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub const FIOCLEX: ::c_ulong = 0x5451;
pub const FIONBIO: ::c_ulong = 0x5421;

pub const SYS_gettid: ::c_long = 224;
pub const SYS_perf_event_open: ::c_long = 336;

extern {
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b64/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ pub const FIOCLEX: ::c_ulong = 0x5451;
pub const FIONBIO: ::c_ulong = 0x5421;

pub const SYS_gettid: ::c_long = 178;
pub const SYS_perf_event_open: ::c_long = 241;
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b64/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ pub const FIOCLEX: ::c_ulong = 0x20006601;
pub const FIONBIO: ::c_ulong = 0x8004667e;

pub const SYS_gettid: ::c_long = 207;
pub const SYS_perf_event_open: ::c_long = 319;
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/other/b64/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub const PTRACE_GETREGS: ::c_uint = 12;
pub const PTRACE_SETREGS: ::c_uint = 13;

pub const SYS_gettid: ::c_long = 186;
pub const SYS_perf_event_open: ::c_long = 298;

extern {
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
Expand Down

0 comments on commit 8a4e72e

Please sign in to comment.