Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9890296rwd; Wed, 21 Jun 2023 13:15:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xLDiZWvKu5aFDkQrOu5kn+nVffJQ8ZWLK3tcZF2Rl/JysDUSPDF0s50oq1ATXSJTF9Eg6 X-Received: by 2002:a54:4495:0:b0:397:ec35:f5a6 with SMTP id v21-20020a544495000000b00397ec35f5a6mr14080837oiv.57.1687378556270; Wed, 21 Jun 2023 13:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687378556; cv=none; d=google.com; s=arc-20160816; b=WmOulXrUm7PFpsjEE9GYV21EZ78rtmxotSPHcd+jAO2qka3Lh3vzskDyKvi/uVCZiE ASPwlggpXzXwL5yVq27Eb2EHinvQSAwPFJZpvsNk8FXBRy4aul0FlLXRx8+XL1DZjS1f gQRAiB5hPvwqhLhvq9hHkxqN2NpuxIDCfCkXaYeEI023eDYhuARpWiUjaiI7JIQdIQu0 Xx5FohohamZicuQMpVWzURBmZ1Hx47Ckl+gFsa7pp5k1oVuK4lko7zv+SSsUKNhDYwoE cdPebvljB08Sy9uaUg7GCS+Lu4OcEfJ/BUICRT/Lcy/aHj5gikm9prd7hDA6jKQaD/Y3 USXg== 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=PIku/vKknpxMbgecYJtwrcoNOyOjrqW+/Ub58y9LPOY=; b=0IyidumBrgJZu7/L7paKgO+MHEWYTfL/FmhutzvNxtQGdsHVnJtYEfOYnuqziV5Jmv D7OUnkXEyTt4vAm+jVqG4F4qgs/QuVPZ7PbrTw/rT6DQ+QrLpuhZJtRqSd5kbgc6W+zk n7NRAqMONrn9cVkRsaXC2KGP6b806RkIM0LxdWuQzLHz1oew7MV09eEjXmfHo/F0B/b6 DWVq2AnCv9N0AWiKXtb07b8wLzBxYsDrKkMMAmMugWHzD4Nf9BfTAbH+RKZLadDWFQ4l /bkeoXWoz+tqCFPGPmzrYvMbTCEU3w601Uzldp8HSaE+usfPEsnBfHFMeGNpFVoI0mp2 ZENg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=MDXMbwHs; 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 j135-20020a636e8d000000b005572a215a0esi2914894pgc.643.2023.06.21.13.15.43; Wed, 21 Jun 2023 13:15:56 -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=MDXMbwHs; 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 S230143AbjFUToB (ORCPT + 99 others); Wed, 21 Jun 2023 15:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbjFUToA (ORCPT ); Wed, 21 Jun 2023 15:44:00 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A81B01735; Wed, 21 Jun 2023 12:43:59 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-25edb50c3acso3606459a91.1; Wed, 21 Jun 2023 12:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687376639; x=1689968639; 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=PIku/vKknpxMbgecYJtwrcoNOyOjrqW+/Ub58y9LPOY=; b=MDXMbwHs8SucUzVGA66AedfSlwZGbOqK4Cu9DoOxAiLj6K9y2xTdCTTkpnU5VEcjFw KfNU58CV+ulE0B89+TW7PQUCNrL3xBXDyLO8OgJW9atW/glff6+ARyo/Yt5jnjLOJ+PO xJixT3BngqBE5gOf/dsu+dwmypmCS9YUVVRnoN7i/mWON95jbPnTDLGU5zIc+YumeTQH s4iAsYKrVNFuwei51KmqN81hOlQBpySFbxQ0Fu2zquvGCdoIGiWcghhxtXmHpGFpwesT /K+sF3RgJ2k43wnwr42tOchoOMjNeLEaD75ItWd6AxWtbczUXh4ZIe9OasYbY0nkD3ZT ZWKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687376639; x=1689968639; 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=PIku/vKknpxMbgecYJtwrcoNOyOjrqW+/Ub58y9LPOY=; b=YGD7zOwxYVts+UfxXebgvgWuJGiOA9ebbJRzGy4PLSgkLgMaLd3rSU69PTCbxgtvgx +ywmQm1IJ39I5yO3J8TZWp3VfWxNvbG+QTBShFO6O+uBJGmFOH/RxbG9/6mZPlSZ94U5 TeIxHVRXSlCMJOLqsqwm79KBHnBHpOZ66s7LglXio96sEm2RJByaZ9O5PqGyYZrl4CtQ DX/CAEmJe8aAA/rgFwqQpfdQGM61twrorhAZ8BkvLgKF6AlVTzUjFsANpSVLW2s/kwAG vLNwLsKYGhJOlIGzCJN500XXjlAzFb4utWaBf3J+E7Uelf4frss7uElvPHSdexQIPcFa 1SZg== X-Gm-Message-State: AC+VfDxPfW6BGyiNGHN0yuGuxTnDnkqG+ffhdaR44F3fMkHCNkGqcfRi AYIrXDEQzt8gefgrZ+9kbcA= X-Received: by 2002:a17:90b:a46:b0:25c:2a5d:e06b with SMTP id gw6-20020a17090b0a4600b0025c2a5de06bmr16639436pjb.2.1687376638905; Wed, 21 Jun 2023 12:43:58 -0700 (PDT) Received: from yoga ([2400:1f00:13:6258:556c:aad7:2240:7612]) by smtp.gmail.com with ESMTPSA id d6-20020a17090ad3c600b0024749e7321bsm3561426pjw.6.2023.06.21.12.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 12:43:58 -0700 (PDT) Date: Thu, 22 Jun 2023 01:13:50 +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 5/9] scripts: python: implement function for thread creation Message-ID: 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 Create a thread with the specified name, process ID (pid), and thread ID (tid). The function initializes markers, samples, frameTable, and stackTable structures for the thread. The markers structure defines the schema and data for thread markers, including fields such as 'name', 'startTime', 'endTime', 'phase', 'category', and 'data'. The samples structure defines the schema and data for thread samples, including fields such as 'stack', 'time', and 'responsiveness'. The frameTable structure defines the schema and data for frame information, including fields such as 'location', 'relevantForJS', 'innerWindowID', 'implementation', 'optimizations', 'line', 'column', 'category', and 'subcategory'. The purpose of this function is to create a new thread structure with the necessary data schemas and initial data arrays. These structures provide a framework for storing and organizing information related to thread markers, samples, frame details, and stack information. Signed-off-by: Anup Sharma --- .../scripts/python/firefox-gecko-converter.py | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tools/perf/scripts/python/firefox-gecko-converter.py b/tools/perf/scripts/python/firefox-gecko-converter.py index e5bc7a11c3e6..cdd7f901c13f 100644 --- a/tools/perf/scripts/python/firefox-gecko-converter.py +++ b/tools/perf/scripts/python/firefox-gecko-converter.py @@ -16,6 +16,47 @@ def isPerfScriptFormat(profile): return bool(re.match(r'^\S.*?\s+(?:\d+/)?\d+\s+(?:\d+\d+\s+)?[\d.]+:', firstLine)) def convertPerfScriptProfile(profile): + def _createtread(name, pid, tid): + markers = { + 'schema': { + 'name': 0, + 'startTime': 1, + 'endTime': 2, + 'phase': 3, + 'category': 4, + 'data': 5, + }, + 'data': [], + } + samples = { + 'schema': { + 'stack': 0, + 'time': 1, + 'responsiveness': 2, + }, + 'data': [], + } + frameTable = { + 'schema': { + 'location': 0, + 'relevantForJS': 1, + 'innerWindowID': 2, + 'implementation': 3, + 'optimizations': 4, + 'line': 5, + 'column': 6, + 'category': 7, + 'subcategory': 8, + }, + 'data': [], + } + stackTable = { + 'schema': { + 'prefix': 0, + 'frame': 1, + }, + 'data': [], + } def addSample(threadName, stackArray, time): nonlocal name -- 2.34.1