From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08F2CC77B75 for ; Mon, 22 May 2023 18:31:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233657AbjEVSbL (ORCPT ); Mon, 22 May 2023 14:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233652AbjEVSbK (ORCPT ); Mon, 22 May 2023 14:31:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 444BCC2; Mon, 22 May 2023 11:31:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D5DE962630; Mon, 22 May 2023 18:31:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BCFBC433EF; Mon, 22 May 2023 18:31:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684780268; bh=HPDRB3YeQPummeOvbe8hmabeHiEN8j6DUaDKitIqVEM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aiAhRAsOV3MwCPcnTTTyYHQkIZ2AXd1PIP4HdWEhFZupU6FtWGgf7IOJQPap/ODfP /hlM+ZEZwxI6PkRLPgPgADjh1extQmvxK2ywAzIyvMHyToJqUwrsd1ks/B+44s2SXj 1qe1ZYNSNibxjcjzSHjK9y32cFTLFKUeus2NKUGYelXnRCgjw62/q4yUJqv3P7TTEn swBv7coApXlcDtks85euOYLN42Zb3y9MuymkgNk5llFekbg05ivEMdYFc8EwyhxBh7 GUiSaiJNBKpXJPOEiKDJUArmkpIXyTXcxSi59QhUHXTM1k2sI59RFV4gM2w4J4MJ00 VYBHApzIMi3Xg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 18258403B5; Mon, 22 May 2023 15:31:06 -0300 (-03) Date: Mon, 22 May 2023 15:31:05 -0300 From: Arnaldo Carvalho de Melo To: Anup Sharma Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] perf: test: Add support for testing JSON generated by perf data command Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Em Mon, May 22, 2023 at 03:28:20PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, May 22, 2023 at 11:10:43AM -0700, Ian Rogers escreveu: > > On Fri, May 19, 2023 at 12:41 AM Anup Sharma wrote: > > > > > > This commit adds support for testing the JSON output generated > > > by the perf data command's conversion to JSON functionality. > > > The test script now includes a validation step to ensure that > > > the resulting JSON file is contain valid data. > > > > > > Signed-off-by: Anup Sharma > > > > Acked-by: Ian Rogers > > I'm fixing these and some other identation minor issues: The ones below, using 'set list' on vim, look at the mix of tabs with spaces: +validate_json_format()$ +{$ + echo "Validating Perf Data Converted JSON file"$ + if [ -f "$result" ]$ + then$ + if $PYTHON -c "import json; json.load(open('$result'))" >/dev/null 2>&1$ +^Ithen$ + echo "The file contains valid JSON format [SUCCESS]"$ + else$ + echo "The file does not contain valid JSON format [FAILED]"$ + err=1$ +^I exit$ + fi$ + else$ + echo "File not found [FAILED]"$ + err=2$ + exit$ + fi$ +}$ +$ +test_json_converter_command$ > [acme@quaco perf-tools-next]$ b4 am -ctsl --cc-trailers CAP-5=fXyqWYgR0M0rqG8a2j0sL1WThNX8r49T7EfvkOG32-UqA@mail.gmail.com > Grabbing thread from lore.kernel.org/all/CAP-5%3DfXyqWYgR0M0rqG8a2j0sL1WThNX8r49T7EfvkOG32-UqA%40mail.gmail.com/t.mbox.gz > Checking for newer revisions > Grabbing search results from lore.kernel.org > Analyzing 2 messages in the thread > Checking attestation on all messages, may take a moment... > --- > [PATCH v2] perf: test: Add support for testing JSON generated by perf data command > + Acked-by: Ian Rogers > + Link: https://lore.kernel.org/r/ZGcoJBAGlknjsA/n@yoga > + Signed-off-by: Arnaldo Carvalho de Melo > --- > NOTE: install dkimpy for DKIM signature verification > --- > Total patches: 1 > --- > Link: https://lore.kernel.org/r/ZGcoJBAGlknjsA/n@yoga > Base: not specified > git am ./v2_20230519_anupnewsmail_perf_test_add_support_for_testing_json_generated_by_perf_data_command.mbx > [acme@quaco perf-tools-next]$ git am ./v2_20230519_anupnewsmail_perf_test_add_support_for_testing_json_generated_by_perf_data_command.mbx > Applying: perf: test: Add support for testing JSON generated by perf data command > .git/rebase-apply/patch:59: trailing whitespace. > else > warning: 1 line adds whitespace errors. > tools/perf/tests/shell/test_perf_data_converter_json.sh:48: trailing whitespace. > + else > [acme@quaco perf-tools-next]$ > -- - Arnaldo