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 A7190EB64D9 for ; Thu, 6 Jul 2023 05:47:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232623AbjGFFrH convert rfc822-to-8bit (ORCPT ); Thu, 6 Jul 2023 01:47:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjGFFrH (ORCPT ); Thu, 6 Jul 2023 01:47:07 -0400 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF169110; Wed, 5 Jul 2023 22:47:05 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2b70404a5a0so3206941fa.2; Wed, 05 Jul 2023 22:47:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688622424; x=1691214424; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DAe3DO8JeNcAT9Td7jWMVHE4ZoYfI8wkTCrsNfJQcfM=; b=GhbHCYupYOMrEEjirznOd3DEYa4brv8qj80Cgb1WV7248yKunpWaIm/3jWIZAl6GPq NtrsEsM/curZy5sM1+KEE3PNGmXSW/YhJIw2HpOsnOmBLZcAAiAZqEiE46Mg2ooW2hMR hQoPPPRNrqK6xsEHNjWQFK8pS0oAcATIlTJa+C8nBuUj/YBy/QM4IguSpiANqgHuoOU1 3HU03eghv0j3GkBSnT0x0Jl3u6Ujh9Ku0tL6I5/7ToqhJuFslL+0hYHzgtGxnxSRYdYO /mxRYZft5y3HUVmFr2X+5jrWl3hUU8UZv97+gsoLb/KItaW40f9b+1Tqfd3tEHEMVrQx E0dg== X-Gm-Message-State: ABy/qLbmxYBqq5v4kFMwr41auvGD2QhhVaDTG7q+OJ5LVCjwebB6Q3mk HF0mKBVEgkb7HVtkcYICi4WrbGDWnGOMQeG3/sw= X-Google-Smtp-Source: APBJJlH2A9JGeuMpPfUkDUalNHw1IcFAuO9slDxvx16xMY1cOpb26f+l1AdXlrCse2GEHfv8LIx2GQzNNvM9EhVUGFE= X-Received: by 2002:a05:6512:60f:b0:4f9:5196:5ed0 with SMTP id b15-20020a056512060f00b004f951965ed0mr878972lfe.7.1688622423686; Wed, 05 Jul 2023 22:47:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Namhyung Kim Date: Wed, 5 Jul 2023 22:46:51 -0700 Message-ID: Subject: Re: [PATCH v2 3/7] scripts: python: create threads with schemas To: Anup Sharma Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On Wed, Jul 5, 2023 at 12:47 PM Anup Sharma wrote: > > 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 > 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 95b061a97cbc..e56864e78dc1 100644 > --- a/tools/perf/scripts/python/firefox-gecko-converter.py > +++ b/tools/perf/scripts/python/firefox-gecko-converter.py > @@ -24,6 +24,47 @@ start_time = None > def process_event(param_dict): > global start_time > global thread_map > + 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': [], > + } It seems this function doesn't return anything. Can we have a complete definition? Otherwise it's hard to know how these tables are used. Thanks, Namhyung > > def _addThreadSample(pid, tid, threadName, time_stamp, stack): > thread = thread_map.get(tid) > -- > 2.34.1 >