From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A78EE13D539 for ; Sun, 28 Dec 2025 02:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766887323; cv=none; b=cnjWhuxcSGkAK5azhOzP0Cqs73R8MWNWAdukno8502sZkYLjdBSh3nm3BYRL1srP/stMur3waFdAvL5XNHGp3tZqq2FN3UVGqPkchq/2Xz8MUIJQN47c251XQS87mN9tXSiHouDZzytZhbmt/H5wFEizybX1SocJKuDbpAAxpgI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766887323; c=relaxed/simple; bh=fII0Bdm4FL+a6BLf43uRfKp3TOAlNXLjK8C+g1f4rxo=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=oZfC4MSis4CfvGamF2deufJR+jkj1ay79z8bSTdHmUHFUhBk4Dr/sxMtYE1ehNGwrx0y2YsRpZmX6M7Gxo8WWtP4GeWYxkVbCzKGk5oA8qVYKprMRWlmL31q/iLOYAx2EAXq3Jnxxql6H1uvMgtJn3c58fjsHqTEk9aTLIDLA/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=etsalapatis.com; spf=pass smtp.mailfrom=etsalapatis.com; dkim=pass (2048-bit key) header.d=etsalapatis-com.20230601.gappssmtp.com header.i=@etsalapatis-com.20230601.gappssmtp.com header.b=cYvJnWLK; arc=none smtp.client-ip=209.85.219.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=etsalapatis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=etsalapatis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=etsalapatis-com.20230601.gappssmtp.com header.i=@etsalapatis-com.20230601.gappssmtp.com header.b="cYvJnWLK" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-88a2fe9e200so66254476d6.0 for ; Sat, 27 Dec 2025 18:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etsalapatis-com.20230601.gappssmtp.com; s=20230601; t=1766887319; x=1767492119; darn=lists.linux.dev; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=E08Qi45nnhLYuHRRc4XyDtBq02cSbhXY/oXo8DlJ9zI=; b=cYvJnWLKNugmj3DG6ACti5LMGm/MAfJ8kDxtXtGSMWTJ1ndFH2MSiECZ9L2O0zpZP4 lSHD/D4NFqWLo/0AYBDZiheFcZltR+XuRiv8tH0ETxBkjZ3bpPxpNuBY26TT7EcVcbzg T/Xfdm2zzher6j3wAfjPlEvNSbwBkp02SY+JGki0kItCKXa8T3WUbOdAe4H4+K9lIDFy MUahMkFf1lGyRno6U+62LecddTqd1oX1eG5cdQmYX6Srpt3L/XzaqLUvopgQ99WV0WK4 cWpMiiFlqKE1ggSZJj8UizMHQDWPwlXUv0avR0OmIlQqQatJShMBWcXgpP1/lu+q6K0U 8Tew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766887319; x=1767492119; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=E08Qi45nnhLYuHRRc4XyDtBq02cSbhXY/oXo8DlJ9zI=; b=n+esY/aagxeJEPwZh72l+AoI8iH+VZHQTP77Wv+Uu+Ni/Zq/OdZSTdJjuH3PdijyRL JBIF6saqxjwvBxTs3lMlmLbaT6FwqM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Received: by 2002:ad4:5ba8:0:b0:880:224e:aab1 with SMTP id 6a1803df08f44-88d84528a09mr422360956d6.66.1766887319356; Sat, 27 Dec 2025 18:01:59 -0800 (PST) Received: from localhost ([140.174.219.137]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-88d99d7e8d4sm207989246d6.41.2025.12.27.18.01.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Dec 2025 18:01:58 -0800 (PST) Precedence: bulk X-Mailing-List: sched-ext@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 27 Dec 2025 21:01:57 -0500 Message-Id: From: "Emil Tsalapatis" To: "Kohei Enju" , Cc: "Tejun Heo" , "David Vernet" , "Andrea Righi" , "Changwoo Min" , "Dan Schatzberg" , Subject: Re: [PATCH v1 1/2] tools/sched_ext: fix scx_show_state.py for scx_root change X-Mailer: aerc 0.20.1 References: <20251226084657.75567-1-enjuk@amazon.com> <20251226084657.75567-2-enjuk@amazon.com> In-Reply-To: <20251226084657.75567-2-enjuk@amazon.com> On Fri Dec 26, 2025 at 3:46 AM EST, Kohei Enju wrote: > Commit 48e126777386 ("sched_ext: Introduce scx_sched") introduced > scx_root and removed scx_ops, causing scx_show_state.py to fail when > searching for the 'scx_ops' object. [1] > > Fix by using 'scx_root' instead, with NULL pointer handling. > > [1] > # drgn -s vmlinux ./tools/sched_ext/scx_show_state.py > Traceback (most recent call last): > File "/root/.venv/bin/drgn", line 8, in > sys.exit(_main()) > ~~~~~^^ > File "/root/.venv/lib64/python3.14/site-packages/drgn/cli.py", line 62= 5, in _main > runpy.run_path( > ~~~~~~~~~~~~~~^ > script_path, init_globals=3D{"prog": prog}, run_name=3D"__main__= " > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > ) > ^ > File "", line 287, in run_path > File "", line 98, in _run_module_code > File "", line 88, in _run_code > File "./tools/sched_ext/scx_show_state.py", line 30, in > ops =3D prog['scx_ops'] > ~~~~^^^^^^^^^^^ > _drgn.ObjectNotFoundError: could not find 'scx_ops' > > Fixes: 48e126777386 ("sched_ext: Introduce scx_sched") > Signed-off-by: Kohei Enju Reviewed-by: Emil Tsalapatis > --- > tools/sched_ext/scx_show_state.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/tools/sched_ext/scx_show_state.py b/tools/sched_ext/scx_show= _state.py > index 7cdcc6729ea4..aec4a4498140 100644 > --- a/tools/sched_ext/scx_show_state.py > +++ b/tools/sched_ext/scx_show_state.py > @@ -27,10 +27,13 @@ def read_static_key(name): > def state_str(state): > return prog['scx_enable_state_str'][state].string_().decode() > =20 > -ops =3D prog['scx_ops'] > +root =3D prog['scx_root'] > enable_state =3D read_atomic("scx_enable_state_var") > =20 > -print(f'ops : {ops.name.string_().decode()}') > +if root: > + print(f'ops : {root.ops.name.string_().decode()}') > +else: > + print('ops : ') > print(f'enabled : {read_static_key("__scx_enabled")}') > print(f'switching_all : {read_int("scx_switching_all")}') > print(f'switched_all : {read_static_key("__scx_switched_all")}')