From nobody Sun Dec 14 14:17:53 2025 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) (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 516C722C9E2 for ; Thu, 16 Jan 2025 15:16:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.60.130.6 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737040610; cv=none; b=h6cHoeV1x+xe3CIyo6HB2zwibBBRQdOUXlQ7mlh1MF24h2Q6rigJ0TBSp19Mbn54exbnmc1g9oTWZCu2J+DcXmHtsnal5HI6V+9lgClS1OpntIk/AldPeXuMJI+ZLdr5Nhl6mBQuPM53VG7Vb13AXFA7qd3jA88pSmZj0WQvmoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737040610; c=relaxed/simple; bh=mmMyyzY+Sr5dxI6zrwSS9vxL6Fb93hhif/3UDdLyLok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rbhD5fPn9533arsNtRtRQLChAZq+xAcS+oCUTQKVDPwbCt2AQcPHlOhxfjB/jIET8WBkO13y8Nrn93vIE07DAtBuBCfa4gPFAfbv0QBP/3nvRi+Qt8s1H/2jNjk5TZpkWKYYMuHumLuEcxlhxehEpDDz8r9jfPELYdZWnlcS75Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=c9kwSPxL; arc=none smtp.client-ip=178.60.130.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="c9kwSPxL" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KDhEj6rZsnbJLQP9nTp7biN+PzUTytWOTh55CzIJEfc=; b=c9kwSPxLSieR+JBLR6tmvQeIp5 QblmGooMsbgWNQkVl9qhGeaSQbO+ZE4MEI61mu5+i+pwvFgoO4cSYjdyIxrnp/gbOPnfWzfe+pxMR 11wxKTrYmdd9qjMYy/PQbF4zxdywgn7TCuXvEXgbAm6NWLF0TuOnM0sIlO+leakNWpueuX2zEgAGL VKbjjXy2ImtWX0jz3o1K3dKDFuu5mCxPMY0qLKOcftOs4hwRiVzwclNIKDKo+kbsZNpi1EVQKPWH/ zV9LKC/L6K3o54H7Gm4o+O/nll02py9Fj9zaXiekYz5Q3T7g/B1G0uO07dNZTF2E7/nziijuPNs+0 t/SKiARw==; Received: from [58.29.143.236] (helo=localhost) by fanzine2.igalia.com with utf8esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1tYRbu-00Gi28-Pd; Thu, 16 Jan 2025 16:16:43 +0100 From: Changwoo Min To: tj@kernel.org, void@manifault.com, arighi@nvidia.com Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, Changwoo Min Subject: [PATCH 6/7] sched_ext: Add scx_bpf_event_stat() and scx_read_event() for BPF schedulers Date: Fri, 17 Jan 2025 00:15:42 +0900 Message-ID: <20250116151543.80163-7-changwoo@igalia.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250116151543.80163-1-changwoo@igalia.com> References: <20250116151543.80163-1-changwoo@igalia.com> 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 Content-Type: text/plain; charset="utf-8" scx_bpf_event_stat() is added to the header files so the BPF scheduler can use it. Also, scx_read_event() is added to read an event type in a compatible way. Signed-off-by: Changwoo Min --- tools/sched_ext/include/scx/common.bpf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/sched_ext/include/scx/common.bpf.h b/tools/sched_ext/inc= lude/scx/common.bpf.h index f3e15e9efa76..c526aa8a949a 100644 --- a/tools/sched_ext/include/scx/common.bpf.h +++ b/tools/sched_ext/include/scx/common.bpf.h @@ -78,6 +78,10 @@ struct rq *scx_bpf_cpu_rq(s32 cpu) __ksym; struct cgroup *scx_bpf_task_cgroup(struct task_struct *p) __ksym __weak; u64 scx_bpf_now(void) __ksym __weak; =20 +void scx_bpf_event_stat(struct scx_event_stat *event, size_t event__sz) __= ksym __weak; +#define scx_read_event(e, name) \ + (bpf_core_field_exists((e)->name) ? (e)->name : 0) + /* * Use the following as @it__iter when calling scx_bpf_dsq_move[_vtime]() = from * within bpf_for_each() loops. --=20 2.48.1