Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36001740rwd; Mon, 10 Jul 2023 16:22:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlGPG4gJK4GcaO8XBh3YNRuZamF2t1poABCb6LKz8Cw5cKFzwg8YU2TuuX00jhRbvleV7mEg X-Received: by 2002:a17:90a:778c:b0:262:eb20:2dd8 with SMTP id v12-20020a17090a778c00b00262eb202dd8mr20529309pjk.20.1689031364115; Mon, 10 Jul 2023 16:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689031364; cv=none; d=google.com; s=arc-20160816; b=v2XovqxJIzw22/3lpXqR66SBd/D/FSm8WeQv1q4KqPREQ98L7hkuGOg9cU2rBU+iza 5FUXc5WN3H1n2eBNA7labORBZgoAA5SDLG2CvzHs0jdnx0p5q9SkngkO5jDnZp8HmKwF Cvt6afA57aJe0pyNExu9udPrLnOBcliVplx2EYmkrRGIrMjIKR66MntqRKEgjcE7y/Wh ya6XTtnvdhSjVi0VtwgdZQ9EcFm2rvRfws2C6BcAVLIPiLfwwmc+WkfEWhNcvTwjnFNE n+L13LgZatTBkKpp9iQrsog559JXNZTRrZHR5nP9LErrCYWj0p2bjt4SJo0UJ/iBf51X MMfw== 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=rNmeeRduS9hujTrUN0M+dmMgGxYGX8uEUfhYcfOYymg=; fh=74JdZCcncRx9vhK0g0jCPyLh0X9SLH8kcZrk5gmejJ4=; b=XNWWTw94CWjgBKfEQoeHylbPRbZoXT3WmYyK8JzQbprkowbkd7Tq9oKDRKvBqkCuBh EnHkDVFIM4YxiwH9IS+XCg+hsvLtXRMxTdMpFgMXtzc+6SVbt9wb4c9zEoUhhM37hzVB hYF+lm9hoD0oSZy5Zc+RmVtpOaaVhkbu1frwSerY9S6wlHR0h7kOlbMEojBt3etef36C U6qcaKhcIsETShfqHPDldNx7tF6Z13GROdEv2G72Iza0ctujb2jrtr5gKytKAToaiBTN FwoEnhOFeGFW+fHwgdg3RnXd3maLuYnGFMcYGG27uf3jIfkYEUspiyvITsNVTVyGq2TF j07g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="CPziO0/b"; 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 j10-20020a17090ae60a00b0025bb9fc0fa1si563646pjy.83.2023.07.10.16.22.32; Mon, 10 Jul 2023 16:22:44 -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="CPziO0/b"; 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 S230387AbjGJXKv (ORCPT + 99 others); Mon, 10 Jul 2023 19:10:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjGJXKu (ORCPT ); Mon, 10 Jul 2023 19:10:50 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D4A31BC; Mon, 10 Jul 2023 16:10:42 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-26598fc0825so1752305a91.0; Mon, 10 Jul 2023 16:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689030642; x=1691622642; 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=rNmeeRduS9hujTrUN0M+dmMgGxYGX8uEUfhYcfOYymg=; b=CPziO0/boaqbaHNRFbRAn6svFGoaxS4y3UQaqEdmPdQD100wdIzoZZUBW/OdaFqKyR kVJWKil7yB7MDnWrCkpO0Re0A9fbvIaxU3TXI1RjMy5Pe7Jcwi38EOuuu/2pcGnwsStI 76HznsqwJK3SFEqR94ILTF+sq3Fo8mckSCamxKqiN3y4TPY1sohZZLShFkk63gFjbrLl MLhQxoRaCXrUK8ZSHIcuOA88Y7ZvfquaPuA5CM2R8PXMkPZRbEvTdOfEafvWiJ2EF19s VBWIEGEtAJ40rYhekFltZKyn43g17t3a+qhPx/ylexbrITG9Q2uhyUFh62XodybWS9/v PEsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689030642; x=1691622642; 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=rNmeeRduS9hujTrUN0M+dmMgGxYGX8uEUfhYcfOYymg=; b=lDh/+F8ujKNQnvXLQ9KlDo/k2TOHQ+DQd23mQaFbOAn/yu84SrD8VAr0sLrjKJYywL NBPxU6eZjkxlLSc1mM6xpx5ypXAbStIXzWHN2eBx2nB5bFqRT+Px5MpHzcAO8uY5qblw xIiDYZY4onoCj1wX1Gw7aSIRFWkdVqCdT+1EHLsxanjYFIstsN9Hu8dAu9Wtzhasw2r9 ELcDWPZJd2k45L4bvvASbjqGgaQ+fMvzZ5jXhXPjR0oJbCsaJ+aNPUP9Beugn5fZ54Tj ddjpcdlDGrZ6kjjk86GVUkf5N7mnSLq4HrjzNjiQ4hqv1axXjsWJAFDK+CK2EHMi++Jh ddpQ== X-Gm-Message-State: ABy/qLYzOhl0uXBBWy8h0XQ9RkNG3+MgacVhQ471qVtsepS8HhFynxS9 wyBFnKgArCv0oi03iHA9htU= X-Received: by 2002:a17:90a:8a14:b0:261:219b:13b3 with SMTP id w20-20020a17090a8a1400b00261219b13b3mr20346474pjn.16.1689030641684; Mon, 10 Jul 2023 16:10:41 -0700 (PDT) Received: from yoga ([2400:1f00:13:76f2:868d:bc7d:562b:a5bb]) by smtp.gmail.com with ESMTPSA id 5-20020a17090a018500b0026333ad02c1sm505433pjc.10.2023.07.10.16.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 16:10:41 -0700 (PDT) Date: Tue, 11 Jul 2023 04:40:33 +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 v3 2/6] scripts: python: Extact necessary information from process event 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_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 The script takes in a sample event dictionary(param_dict) and retrieves relevant data such as time stamp, PID, TID, thread name. Also start time is defined. Signed-off-by: Anup Sharma --- .../perf/scripts/python/firefox-gecko-converter.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/perf/scripts/python/firefox-gecko-converter.py b/tools/perf/scripts/python/firefox-gecko-converter.py index 5b342641925c..765f1775cee5 100644 --- a/tools/perf/scripts/python/firefox-gecko-converter.py +++ b/tools/perf/scripts/python/firefox-gecko-converter.py @@ -21,8 +21,19 @@ sys.path.append(os.environ['PERF_EXEC_PATH'] + \ from perf_trace_context import * from Core import * +start_time = None + def trace_end(): pass def process_event(param_dict): - pass + global start_time + # Extract relevant information from the event parameters. The event parameters + # are in a dictionary: + time_stamp = (param_dict['sample']['time'] // 1000) / 1000 + pid = param_dict['sample']['pid'] + tid = param_dict['sample']['tid'] + thread_name = param_dict['comm'] + + # Assume that start time is the time of the first event. + start_time = time_stamp if not start_time else start_time -- 2.34.1