Bump edition to 2024

pull/153/head
Tamir Duberstein 5 days ago
parent 71c366d943
commit e50b81fd67
No known key found for this signature in database

@ -9,6 +9,7 @@ default-members = ["{{project-name}}", "{{project-name}}-common"]
[workspace.package] [workspace.package]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2024"
[workspace.dependencies] [workspace.dependencies]
aya = { version = "0.13.1", default-features = false } aya = { version = "0.13.1", default-features = false }

@ -1,7 +1,7 @@
[package] [package]
name = "{{project-name}}-common" name = "{{project-name}}-common"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition.workspace = true
license.workspace = true license.workspace = true

@ -1,7 +1,7 @@
[package] [package]
name = "{{ project-name }}-ebpf" name = "{{ project-name }}-ebpf"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition.workspace = true
[dependencies] [dependencies]
{{ project-name }}-common = { path = "../{{ project-name }}-common" } {{ project-name }}-common = { path = "../{{ project-name }}-common" }

@ -290,7 +290,7 @@ fn try_{{crate_name}}(ctx: RawTracePointContext) -> Result<i32, i32> {
} }
{%- when "perf_event" %} {%- when "perf_event" %}
use aya_ebpf::{ use aya_ebpf::{
helpers::bpf_get_smp_processor_id, macros::perf_event, programs::PerfEventContext, EbpfContext, EbpfContext, helpers::bpf_get_smp_processor_id, macros::perf_event, programs::PerfEventContext,
}; };
use aya_log_ebpf::info; use aya_log_ebpf::info;
@ -325,6 +325,6 @@ fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {} loop {}
} }
#[link_section = "license"] #[unsafe(link_section = "license")]
#[no_mangle] #[unsafe(no_mangle)]
static LICENSE: [u8; 13] = *b"Dual MIT/GPL\0"; static LICENSE: [u8; 13] = *b"Dual MIT/GPL\0";

@ -1,7 +1,7 @@
[package] [package]
name = "{{project-name}}" name = "{{project-name}}"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition.workspace = true
license.workspace = true license.workspace = true

@ -1,4 +1,4 @@
use anyhow::{anyhow, Context as _}; use anyhow::{Context as _, anyhow};
use aya_build::cargo_metadata; use aya_build::cargo_metadata;
fn main() -> anyhow::Result<()> { fn main() -> anyhow::Result<()> {

@ -3,15 +3,15 @@
use aya::programs::KProbe; use aya::programs::KProbe;
{%- when "fentry" -%} {%- when "fentry" -%}
use anyhow::Context as _; use anyhow::Context as _;
use aya::{programs::FEntry, Btf}; use aya::{Btf, programs::FEntry};
{%- when "fexit" -%} {%- when "fexit" -%}
use anyhow::Context as _; use anyhow::Context as _;
use aya::{programs::FExit, Btf}; use aya::{Btf, programs::FExit};
{%- when "uprobe", "uretprobe" -%} {%- when "uprobe", "uretprobe" -%}
use aya::programs::UProbe; use aya::programs::UProbe;
{%- when "sock_ops" -%} {%- when "sock_ops" -%}
use anyhow::Context as _; use anyhow::Context as _;
use aya::programs::{links::CgroupAttachMode, SockOps}; use aya::programs::{SockOps, links::CgroupAttachMode};
{%- when "sk_msg" -%} {%- when "sk_msg" -%}
use aya::{maps::SockHash, programs::SkMsg}; use aya::{maps::SockHash, programs::SkMsg};
use {{crate_name}}_common::SockKey; use {{crate_name}}_common::SockKey;
@ -19,27 +19,27 @@ use {{crate_name}}_common::SockKey;
use anyhow::Context as _; use anyhow::Context as _;
use aya::programs::{Xdp, XdpFlags}; use aya::programs::{Xdp, XdpFlags};
{%- when "classifier" -%} {%- when "classifier" -%}
use aya::programs::{tc, SchedClassifier, TcAttachType}; use aya::programs::{SchedClassifier, TcAttachType, tc};
{%- when "cgroup_skb" -%} {%- when "cgroup_skb" -%}
use anyhow::Context as _; use anyhow::Context as _;
use aya::programs::{links::CgroupAttachMode, CgroupSkb, CgroupSkbAttachType}; use aya::programs::{CgroupSkb, CgroupSkbAttachType, links::CgroupAttachMode};
{%- when "cgroup_sysctl" -%} {%- when "cgroup_sysctl" -%}
use anyhow::Context as _; use anyhow::Context as _;
use aya::programs::{links::CgroupAttachMode, CgroupSysctl}; use aya::programs::{CgroupSysctl, links::CgroupAttachMode};
{%- when "cgroup_sockopt" -%} {%- when "cgroup_sockopt" -%}
use anyhow::Context as _; use anyhow::Context as _;
use aya::programs::{links::CgroupAttachMode, CgroupSockopt}; use aya::programs::{CgroupSockopt, links::CgroupAttachMode};
{%- when "tracepoint" -%} {%- when "tracepoint" -%}
use aya::programs::TracePoint; use aya::programs::TracePoint;
{%- when "lsm" -%} {%- when "lsm" -%}
use aya::{programs::Lsm, Btf}; use aya::{Btf, programs::Lsm};
{%- when "perf_event" -%} {%- when "perf_event" -%}
use aya::{ use aya::{
programs::{perf_event, PerfEvent}, programs::{PerfEvent, perf_event},
util::online_cpus, util::online_cpus,
}; };
{%- when "tp_btf" -%} {%- when "tp_btf" -%}
use aya::{programs::BtfTracePoint, Btf}; use aya::{Btf, programs::BtfTracePoint};
{%- when "socket_filter" -%} {%- when "socket_filter" -%}
use aya::programs::SocketFilter; use aya::programs::SocketFilter;
{%- when "raw_tracepoint" -%} {%- when "raw_tracepoint" -%}

Loading…
Cancel
Save