Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp109534ybg; Mon, 8 Jun 2020 17:52:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcbI4/wMtSDJW1GXA4OucxdL74rSAjM2gsnqUJpwCuEPS+TXjAvWodMrP+R1k2MPbxghrS X-Received: by 2002:a05:6402:1a48:: with SMTP id bf8mr24922844edb.133.1591663931326; Mon, 08 Jun 2020 17:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591663931; cv=none; d=google.com; s=arc-20160816; b=0m8McdRPa0JmOMRI/TUs0EPy/1MICd3m03iGGeakqhLrSHcYVeAkBPDYSx0s5sg2V+ DD1YVk1gHgurTuDdhztDALmCHPqSbJ8FWjxv+RtNl4WIfZGUzegjHrDSPS4LuVagZ2fM aU+kJWiFtgkXyg5GhkgIk/8QBryBeHNo/L5Q60Xm/l9PMN2a7YlofXKgdPXOffnzm4tK 4XIpUnroWcB9+EwXVZg2nRI2kK0t4IaCb6/aRmuJ8yS68xBrtOCpM5uEsM1oiUJsLQPh uj2M3JlyVD3+rnTwNZo0zcUQMq1QIqd3rtEh+4eRVJeq1zuIDjYZBPt76uyMeAXTaYb1 QyjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DUlrvCpZNSR1ssLqdeZg2QQnEl4xgIpuV/jvLA7eH40=; b=B0YqPYeHvXocD15+b82sX2hS4Ns6+yfRIaDjUS2dSCCtL6Y3y9Mvi9SiIrhmHsSGp8 1mb7b5tiznHQAqPXUxkvC5/zVK1cq3iu4et72STTSgFRQ4CaO3tn8WyaBFxIasyMNVIt hcY/VSv5DpDkHHPBo6lr7pt6OUKuCQd0NSYi866d5Dcrm+SpQ89LlHARbOIh1FtRUqwp iR9hC5Lsf3awedNF6rkg4ZzBO9I9a9M2MF+ZuuQ0tiRqh19OXcRFAfmQpjlVXl+L/YRD YaqQjjkMHwrxGQQDwP7NJlCciWvwFy35wgFVMfZ+z7e6vSQYpUdBas3ajH7F+8dLyBn8 3myw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hLtAkA+W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox6si9469787ejb.678.2020.06.08.17.51.48; Mon, 08 Jun 2020 17:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hLtAkA+W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728693AbgFHXKg (ORCPT + 99 others); Mon, 8 Jun 2020 19:10:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:55132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728410AbgFHXJZ (ORCPT ); Mon, 8 Jun 2020 19:09:25 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3B582208B8; Mon, 8 Jun 2020 23:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657764; bh=pRLBDBQ9z6eh6B+AyGoduKroeDK6488kLgakcE/Mq3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hLtAkA+Wd5CwJ9Yt0YPDwROnAp5viopj6jeQqcp0JsD2FwWcv0qavmLBFp1QJ35IP cng/I1mJxtGdVQN2lXY2FNISkOu0VRT8pyzPH64shrRjtcq9UszHz0HMfDevfj/Lvm /mMkqqXQPJ8Ej/30POh4SBmg3IHCb4v0dEcNRitU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tejun Heo , Jens Axboe , Sasha Levin Subject: [PATCH AUTOSEL 5.7 149/274] iocost_monitor: drop string wrap around numbers when outputting json Date: Mon, 8 Jun 2020 19:04:02 -0400 Message-Id: <20200608230607.3361041-149-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tejun Heo [ Upstream commit 21f3cfeab304fc07b90d93d98d4d2f62110fe6b2 ] Wrapping numbers in strings is used by some to work around bit-width issues in some enviroments. The problem isn't innate to json and the workaround seems to cause more integration problems than help. Let's drop the string wrapping. Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- tools/cgroup/iocost_monitor.py | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tools/cgroup/iocost_monitor.py b/tools/cgroup/iocost_monitor.py index 9d8e9613008a..103605f5be8c 100644 --- a/tools/cgroup/iocost_monitor.py +++ b/tools/cgroup/iocost_monitor.py @@ -112,14 +112,14 @@ class IocStat: def dict(self, now): return { 'device' : devname, - 'timestamp' : str(now), - 'enabled' : str(int(self.enabled)), - 'running' : str(int(self.running)), - 'period_ms' : str(self.period_ms), - 'period_at' : str(self.period_at), - 'period_vtime_at' : str(self.vperiod_at), - 'busy_level' : str(self.busy_level), - 'vrate_pct' : str(self.vrate_pct), } + 'timestamp' : now, + 'enabled' : self.enabled, + 'running' : self.running, + 'period_ms' : self.period_ms, + 'period_at' : self.period_at, + 'period_vtime_at' : self.vperiod_at, + 'busy_level' : self.busy_level, + 'vrate_pct' : self.vrate_pct, } def table_preamble_str(self): state = ('RUN' if self.running else 'IDLE') if self.enabled else 'OFF' @@ -179,19 +179,19 @@ class IocgStat: def dict(self, now, path): out = { 'cgroup' : path, - 'timestamp' : str(now), - 'is_active' : str(int(self.is_active)), - 'weight' : str(self.weight), - 'weight_active' : str(self.active), - 'weight_inuse' : str(self.inuse), - 'hweight_active_pct' : str(self.hwa_pct), - 'hweight_inuse_pct' : str(self.hwi_pct), - 'inflight_pct' : str(self.inflight_pct), - 'debt_ms' : str(self.debt_ms), - 'use_delay' : str(self.use_delay), - 'delay_ms' : str(self.delay_ms), - 'usage_pct' : str(self.usage), - 'address' : str(hex(self.address)) } + 'timestamp' : now, + 'is_active' : self.is_active, + 'weight' : self.weight, + 'weight_active' : self.active, + 'weight_inuse' : self.inuse, + 'hweight_active_pct' : self.hwa_pct, + 'hweight_inuse_pct' : self.hwi_pct, + 'inflight_pct' : self.inflight_pct, + 'debt_ms' : self.debt_ms, + 'use_delay' : self.use_delay, + 'delay_ms' : self.delay_ms, + 'usage_pct' : self.usage, + 'address' : self.address } for i in range(len(self.usages)): out[f'usage_pct_{i}'] = str(self.usages[i]) return out -- 2.25.1