From nobody Tue Dec 16 05:46:58 2025 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56911264F85 for ; Mon, 24 Feb 2025 17:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740416570; cv=none; b=FdsjMjWEcACNDzituT4p+nu1JlsKDL+wclm3lzUk9p+iFLoaD+4ZavbIytnHi0qCU+RU0I0nqvfxjpEHwLOgUK2/F5oLntd85dBbovLFWkx17dQvrtiwLN4Y2ojpntcZUwEpmozNt8D28TGbMZIL6ZXnF9Tby7dPcvKqsBLhVwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740416570; c=relaxed/simple; bh=2/tNsQbKiTkaxCoHs1UKZQvUCGIwo1zazwTLngtVyq0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QfvXPMqMeBsxlOCfps6+evwYg4l8nN0aE57nJS5AMTm4xZSLStXmCopDHxGU5AwZZo1OQOQNcgAqGtEx8Ao6y/CVhIJYW4pIce7y4r5tAm03mU3hwQFmpRJGjmwxcNeDjRIHJiGtoCLbJwQC1pK/gztvAeHCi2Pj6S2j1EFPYC0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=V5ChfgId; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="V5ChfgId" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1740416565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z6dFsrJK1KUGJWoZLEUFQHIqOltFLVPZ4LRzfSz7zsM=; b=V5ChfgIdY+YuXDWOmrz5dDv7LDtZpqj3plpZq5HR6FE8Mp/6gXq9WETqpPal5m9wiPBSe5 PfCihKDs9jgUVJt/b72G+O6c35N2j+VDY2NIdDEWFWDCNVNYj/8H+lVxP7Hy2QIJBMcEKa chKZ/qBrAnhr2K68D+2eTJ4W2g3p7xk= From: Tao Chen To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, haoluo@google.com, jolsa@kernel.org, qmo@kernel.org Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, chen.dylane@gmail.com, Tao Chen Subject: [PATCH bpf-next v8 4/5] libbpf: Init kprobe prog expected_attach_type for kfunc probe Date: Tue, 25 Feb 2025 00:59:11 +0800 Message-Id: <20250224165912.599068-5-chen.dylane@linux.dev> In-Reply-To: <20250224165912.599068-1-chen.dylane@linux.dev> References: <20250224165912.599068-1-chen.dylane@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Kprobe prog type kfuncs like bpf_session_is_return and bpf_session_cookie will check the expected_attach_type, so init the expected_attach_type here. Signed-off-by: Tao Chen --- tools/lib/bpf/libbpf_probes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/libbpf_probes.c b/tools/lib/bpf/libbpf_probes.c index 8efebc18a215..bb5b457ddc80 100644 --- a/tools/lib/bpf/libbpf_probes.c +++ b/tools/lib/bpf/libbpf_probes.c @@ -126,6 +126,7 @@ static int probe_prog_load(enum bpf_prog_type prog_type, break; case BPF_PROG_TYPE_KPROBE: opts.kern_version =3D get_kernel_version(); + opts.expected_attach_type =3D BPF_TRACE_KPROBE_SESSION; break; case BPF_PROG_TYPE_LIRC_MODE2: opts.expected_attach_type =3D BPF_LIRC_MODE2; --=20 2.43.0