Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp766442ybk; Fri, 15 May 2020 12:59:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw4mjWdb0fy+VI5K3fURPbPpWx+cWKz4/lm5OROjXnPlxMIF38fxdvtN2CunJot0cDUqQk X-Received: by 2002:a50:cdc8:: with SMTP id h8mr4358967edj.26.1589572791399; Fri, 15 May 2020 12:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589572791; cv=none; d=google.com; s=arc-20160816; b=BKcQCDLQXgyEqKMD2UCbfnAJaAIV+gVat5uxhk95HeUSwu3g2hO6pp4f4g61zx2qbL JkgwifW6NwjOvFC+0cYdVlbUoOaSBSYF4N5ZkIFEarUMSLSfuWRvhjGCaDdtzhkxg3ZJ KBcm3oiiKSIZ4GOazswbllJEWXoKmw2JgB12wn1JCqh6AF1m8cJsHb0e2P+0uu+k0rAJ 1KZ2eXQVoCGnLPp8rUguF2rM6rPITprCdq0e8KZicCPXIT8z3dgRvo/SMGGwHwALpaXj rbm7nmty76fwuU2K0Yeu0WXGED/ejUbz8DLeVaYtLnbt/FU2M760BwGO5STKc4rGibEK aBmw== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:ironport-sdr:ironport-sdr; bh=Ipb3Un4hIbTpO9jQx+i88tiiqC7cBx8MQvX+Rmf8n8E=; b=PCjV86LB+diAwQ5Hgjaw/rsPIzm7qUjCVrFQg/X5hOkXGETmZgNxgiNzRxVUxFAT2k PDFTEzglhkc8lA4jzxX0YEaxiTST/KP/O/rHn1ZCc/8pq/8Yqf3R5a7DfSywIvAvAtrr CQumwtuBjRe/DtpoDC7CpEPNjZ9WqKZRRz256R5DoWUKdaJNCgfqyecj0Wr6efx4FM6u Ra6AQn7aLU9KODeXYfIHm5wfYB4Q1JyHE5lCU8AbXzhR6Gem8KKw9uJhWLKalZtedr9H QAAaUWO/rw5F1FRyyoojHJdZin5U+EF0FNnHiG5ENUDFqu2hWt/IAShH9ABMFdpc9hE/ VmHA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a26si1719858edr.356.2020.05.15.12.59.28; Fri, 15 May 2020 12:59:51 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbgEOT6C (ORCPT + 99 others); Fri, 15 May 2020 15:58:02 -0400 Received: from mga11.intel.com ([192.55.52.93]:43089 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgEOT6C (ORCPT ); Fri, 15 May 2020 15:58:02 -0400 IronPort-SDR: b93uiDPD0nDgqf4jbObbnUGE19reamiSAVoxZ0geDA3xK5i31cYq0/6nDK6TXS9NNkERcwmU8B iz+ml8MA+9tQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2020 12:58:02 -0700 IronPort-SDR: bMcy2/ab4q9wsRnUBLnsKTHVlFjku/UqAiSmwHpDjtMcKcCvi7GWo3MOSlIZOSZa7BdUpFx2Kd +kY9guWBgWTQ== X-IronPort-AV: E=Sophos;i="5.73,396,1583222400"; d="scan'208";a="464838181" Received: from spandruv-mobl.amr.corp.intel.com ([10.212.76.184]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2020 12:58:01 -0700 Message-ID: <6eb0773d64cd5a4e25ca6d1c78c9c3ed7d190f46.camel@linux.intel.com> Subject: Re: [PATCH] intel-speed-select: Fix json perf-profile output output From: Srinivas Pandruvada To: Prarit Bhargava , linux-kernel@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Date: Fri, 15 May 2020 12:58:01 -0700 In-Reply-To: <20200511190628.25661-1-prarit@redhat.com> References: <20200511190628.25661-1-prarit@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-05-11 at 15:06 -0400, Prarit Bhargava wrote: I prefer prefix as: "tools/power/x86/intel-speed-select" instead of just "intel-speed-select". Fixed and applied. Thanks, Srinivas > The 'intel-speed-select -f json perf-profile get-lock-status' command > outputs the package, die, and cpu data as separate fields. > > ex) > > "package-0": { > "die-0": { > "cpu-0": { > > Commit 74062363f855 ("tools/power/x86/intel-speed-select: Avoid > duplicate Package strings for json") prettied this output so that it > is a single line for > some json output commands and the same should be done for other > commands. > > Output package, die, and cpu info in a single line when using json > output. > > Signed-off-by: Prarit Bhargava > Cc: Srinivas Pandruvada > Cc: platform-driver-x86@vger.kernel.org > --- > .../x86/intel-speed-select/isst-display.c | 26 +++++++++++++-- > ---- > 1 file changed, 18 insertions(+), 8 deletions(-) > > diff --git a/tools/power/x86/intel-speed-select/isst-display.c > b/tools/power/x86/intel-speed-select/isst-display.c > index f6e2ce181123..e105fece47b6 100644 > --- a/tools/power/x86/intel-speed-select/isst-display.c > +++ b/tools/power/x86/intel-speed-select/isst-display.c > @@ -316,21 +316,31 @@ void isst_ctdp_display_core_info(int cpu, FILE > *outf, char *prefix, > { > char header[256]; > char value[256]; > + int level = 1; > + > + if (out_format_is_json()) { > + snprintf(header, sizeof(header), "package-%d:die- > %d:cpu-%d", > + get_physical_package_id(cpu), > get_physical_die_id(cpu), > + cpu); > + format_and_print(outf, level++, header, NULL); > + } else { > + snprintf(header, sizeof(header), "package-%d", > + get_physical_package_id(cpu)); > + format_and_print(outf, level++, header, NULL); > + snprintf(header, sizeof(header), "die-%d", > + get_physical_die_id(cpu)); > + format_and_print(outf, level++, header, NULL); > + snprintf(header, sizeof(header), "cpu-%d", cpu); > + format_and_print(outf, level++, header, NULL); > + } > > - snprintf(header, sizeof(header), "package-%d", > - get_physical_package_id(cpu)); > - format_and_print(outf, 1, header, NULL); > - snprintf(header, sizeof(header), "die-%d", > get_physical_die_id(cpu)); > - format_and_print(outf, 2, header, NULL); > - snprintf(header, sizeof(header), "cpu-%d", cpu); > - format_and_print(outf, 3, header, NULL); > if (str0 && !val) > snprintf(value, sizeof(value), "%s", str0); > else if (str1 && val) > snprintf(value, sizeof(value), "%s", str1); > else > snprintf(value, sizeof(value), "%u", val); > - format_and_print(outf, 4, prefix, value); > + format_and_print(outf, level, prefix, value); > > format_and_print(outf, 1, NULL, NULL); > }