Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9881676rwd; Wed, 21 Jun 2023 13:08:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BC6ws51CF/C5gpxCijGvk76AAcuY9iV9xuO444xZZ5va8R8FtqlO2j2disxgatBhwjlSC X-Received: by 2002:a17:902:ea83:b0:1b0:7c3c:31f9 with SMTP id x3-20020a170902ea8300b001b07c3c31f9mr12843045plb.53.1687378098584; Wed, 21 Jun 2023 13:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687378098; cv=none; d=google.com; s=arc-20160816; b=AYtL5zlBBwqzAjq44Obagja4q+J4W0X68iVpuBndlfDTHcFmUO+rRZxqNLfp4d9QQE KfgI87/lafIZ0SZ3BiVqiqNqE8SSLJr795pNj5ZvkqwFF8zbdsxnCeukdzN7TdwNbVc1 sx19RH6oHq1TfWqu+7zDj4cBZmh634lICwgRLQggV5dGWAZTxIs70Q81Q+Dy8UjQo+kw +YSYthadMUHR5yuGlCtQycnKjWFa+FKf3MbL7UULpG10PJouwM+JDUZnB082QfWrE4qd VCdzm299jD2KqNzCJZuP/SqEfyKPJoDV68koAgShNPai3UNHDk0eGas8lVey/ofq62cq hQDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=B1YrRd+md0IIhC3jIqeqxvAewmHxT4sxnDw+1V2ULFc=; b=ye9Z794SZDAVSIa9EcZYgE43s72FthUTs48luL3Y2wp4n//KOMIt9ZIarvMGzczK39 YD0HicyzHJnS1SHh2wEY23HdZ9THK+hJyqHw3f+bENHV+oW1dzYhcnta0Fcx+PGwCr9B /9TdIdyQ1v0cvuZxw+wlOOyIP/6RMAB53kkBUBXEuiDkY+oi1RT2i/ghOuD2u9e8j9JL +3Qf1KwtyQzru2ZCpCMsGrJ8uuRp7w6/rhprYef2TVueW1TkTHUCZPY4hXJkcuwFnffA y9j0FmwTuymJ7TlFlplZMrX4JRTV7Vl58tibB+vBEHzUEKJE/Wjcvpkzq15PB1OjEksz uhvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Jr0xlHsO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a170902e34c00b001b530ede2ebsi3430766plc.119.2023.06.21.13.08.05; Wed, 21 Jun 2023 13:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Jr0xlHsO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230184AbjFUTrI (ORCPT + 99 others); Wed, 21 Jun 2023 15:47:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbjFUTrG (ORCPT ); Wed, 21 Jun 2023 15:47:06 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0264FE65; Wed, 21 Jun 2023 12:47:06 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-25efb821778so2340487a91.3; Wed, 21 Jun 2023 12:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687376825; x=1689968825; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=B1YrRd+md0IIhC3jIqeqxvAewmHxT4sxnDw+1V2ULFc=; b=Jr0xlHsOkdoU24dUH2EQoSvufaYjE1yWgtUt8I2Jx0sijY8ZUrSXUVM6DsMB828nDo jgpEM1KFVJ5nKeyQInPLRlWwIC4rGSmP0IJP4ygA7G5qcbJg++ICAMit4/EqluArmWhA 0UhPD0eGYW0NXqcqrUYXifWtqjyVZgcdr1EHD7hG586+JSil7/X3SDV+YPnRutk5AYR4 Yv5n2/GGimGq7XO8gdVzxQmNvriTeUCa/PNokBHLXe4bnCqHinGthbHQoHrRgGqvp0QI lvciLdqOyBcwhauFFqkqXJ3w/exq2KtUqbQXdiOwx/+WNVxTe9FY9yrvUpQNa6bP2mJy 5pSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687376825; x=1689968825; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=B1YrRd+md0IIhC3jIqeqxvAewmHxT4sxnDw+1V2ULFc=; b=bXZIADFE3lgwcZNqKvHXwklhENI9hKpQGuJzckQr1Zysak4sxSKu4wIOYqXuEVroYO ksSApflJJTY1ukHuqiQ+PxDjhuLfDVZVwPH2Rc4aTLyOlLtBvfv3fVM90waPpukQ+v1M /YDn46uw0nnME2LCgShhzNmLu60Ffc0dbVlQaClo/Aj5QRWeBb9qVsV9ZVrI7HJwQbIr hYCQ1W2hDb/eh5JE1IkHr2GMQ3hWDU0GLZ8CLSloaGAE4StPOxXTBarhfWZ3nxjyOsD6 HyO+OqSqB12UU5Jvc6qVG7uDGD0jaXzMLbIVs7GhXHI6UsQhntBR88p/vrS+Cph1LWVN AY4Q== X-Gm-Message-State: AC+VfDzPTMw7lNkNZrKdmKTIU/tHEX5DVE1ukUWMwt1ni0rJrXfDLwFo Nf3hWlhM2KfuRwp/SmPKKwY= X-Received: by 2002:a17:90b:3cc:b0:25e:b055:220c with SMTP id go12-20020a17090b03cc00b0025eb055220cmr11655495pjb.33.1687376825323; Wed, 21 Jun 2023 12:47:05 -0700 (PDT) Received: from yoga ([2400:1f00:13:6258:556c:aad7:2240:7612]) by smtp.gmail.com with ESMTPSA id iq22-20020a17090afb5600b00259b729eea9sm3558879pjb.8.2023.06.21.12.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 12:47:05 -0700 (PDT) Date: Thu, 22 Jun 2023 01:16:58 +0530 From: Anup Sharma To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Anup Sharma , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] scripts: python: Add temporary main function for testing purposes Message-ID: <796905fa13aeb7621825d8a5a370f1fc78bbf298.1687375189.git.anupnewsmail@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit introduces a temporary main function for ease of testing. Please note that this function is not intended to be a permanent part of the codebase. The output is serialized as JSON and printed to the standard output (stdout) with an indentation of 2 for better readability. Signed-off-by: Anup Sharma --- tools/perf/scripts/python/firefox-gecko-converter.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/perf/scripts/python/firefox-gecko-converter.py b/tools/perf/scripts/python/firefox-gecko-converter.py index 385a8b77a70a..0f133d9acee9 100644 --- a/tools/perf/scripts/python/firefox-gecko-converter.py +++ b/tools/perf/scripts/python/firefox-gecko-converter.py @@ -236,3 +236,14 @@ def convertPerfScriptProfile(profile): 'pausedRanges': [] } +def main(): +# inputFile = input('Enter input file name: ') + with open('perf_data.txt') as f: + profile = f.read() + isPerfScript = isPerfScriptFormat(profile) + output = convertPerfScriptProfile(profile) + json.dump(output, sys.stdout, indent=2) +# print('isPerfScript: {}'.format(isPerfScript)) + +if __name__ == '__main__': + main() -- 2.34.1