From nobody Thu Jul 14 23:34:24 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LkW6S6XvZz4TDxR for ; Thu, 14 Jul 2022 23:34:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LkW6S4VXyz3pnX for ; Thu, 14 Jul 2022 23:34:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LkW6S3ZMVzLtY for ; Thu, 14 Jul 2022 23:34:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 26ENYOvj085698 for ; Thu, 14 Jul 2022 23:34:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 26ENYOj5085697 for bugs@FreeBSD.org; Thu, 14 Jul 2022 23:34:24 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 265223] libxo json output for ps uses strings for numeric properties Date: Thu, 14 Jul 2022 23:34:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: wes@wezm.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657841664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=utLvsMpXJ+d8cdIjlxJtKRhjto8nPRPQ3VsdeD8uI2k=; b=vSfJIn6hJpTDXOenxbzqIObCMPPqhBlYxk4VEiW8Mzz/ZOdIVl93hAjzg8NkMvMZgV0/qt 5a0gU/ThHwzOJb7tszducgqf2PL+fhPovsVOMt6vAoKqiR2I3wyftFarLQHWjw6a9OxVQ1 YqFjpmIBeD7mAVH+JoeBobe/AyKzM1f7o4OCzPcGclJioWc6XLRd9B61UnwJzu7FbTS3+f 0+ft67/tc7br9GIGV6FjdGUHoyypnsi34Cf+fcXc3bNehl5iHJ6lRrXjvr0nvjoTwQKZT1 TbtYaptZ48Y113A46mWrgAykjOEq0v8Sco2hHrLx/tKxr+WyTIvKyjWPoa/cVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657841664; a=rsa-sha256; cv=none; b=RDYimUMyLr8pJditx7OzkzqRy2M6TjEcIZ2vuG4rLmp0rfbD5oIVDOaga1WghfEvI0j8dn RkzkGGyx+DHb4RGM5+i/tLdY/lEK3W+nb9lJ8luU1rxHk+HldkQfKrGbym+5y+xFJ2Mh4I N64ovxPg2b+uBA0hP8Ea4xBXVW2GbVggVRtJ/2WjgHqWyycIvQmXwFPB+FKJ3QtfDqyD3D /sDyG4f+wgY8Dkf3wQ5sTr96+1FEiC1xwkUF1FPf3EQuB05ZC5j8G0SWGPAOtZJ7yr4wz6 SoUrrHWWarmi6Sfp8mAuiaywJCepB3CscDPXORbEZp6RB27kvbgPlGV3zDKE4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265223 Bug ID: 265223 Summary: libxo json output for ps uses strings for numeric properties Product: Base System Version: 13.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: wes@wezm.net It seems that all the properties that are collected for output in `ps` are stringified in format_output[1]. As a result values that are numeric end up= as strings in the libxo json output. E.g. $ ps --libxo json,pretty -o pid,command,pcpu { "process-information": { "process": [ { "pid": "30811", "command": "-sh (sh)", "percent-cpu": "0.0" }, { "pid": "30816", "command": "ps --libxo json,", "percent-cpu": "0.0" }, { "pid": "16796", "command": "./mqttd", "percent-cpu": "0.0" } ] } } The expected behaviour in this example would be for `pid` and `percent-cpu`= to be JSON numbers (although this issue is not limited to just these fields). = I.e. { "pid": 16796, "command": "./mqttd", "percent-cpu": 0.0 } For comparison I note that the libxo output of `df` does use the correct ty= pes: { "name": "zroot/usr/src", "total-blocks": 24195196, "used-blocks": 96, "available-blocks": 24195100, "used-percent": 0, "mounted-on": "/usr/src" }, [1]: https://cgit.freebsd.org/src/tree/bin/ps/ps.c?id=3D60052a11db8e729e8df92611= c05135f009c01081#n1204 --=20 You are receiving this mail because: You are the assignee for the bug.=