lib.rs 685 B

123456789101112131415161718192021222324252627
  1. #![no_std]
  2. use aya_bpf::{
  3. macros::map,
  4. maps::{PerCpuArray, PerfEventByteArray},
  5. };
  6. pub use aya_log_common::{write_record_header, Level, WriteToBuf, LOG_BUF_CAPACITY};
  7. pub use aya_log_ebpf_macros::{debug, error, info, log, trace, warn};
  8. #[doc(hidden)]
  9. #[repr(C)]
  10. pub struct LogBuf {
  11. pub buf: [u8; LOG_BUF_CAPACITY],
  12. }
  13. #[doc(hidden)]
  14. #[map]
  15. pub static mut AYA_LOG_BUF: PerCpuArray<LogBuf> = PerCpuArray::with_max_entries(1, 0);
  16. #[doc(hidden)]
  17. #[map]
  18. pub static mut AYA_LOGS: PerfEventByteArray = PerfEventByteArray::new(0);
  19. #[doc(hidden)]
  20. pub mod macro_support {
  21. pub use aya_log_common::{DisplayHint, Level, LOG_BUF_CAPACITY};
  22. pub use aya_log_ebpf_macros::log;
  23. }