Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27803154rwd; Tue, 4 Jul 2023 08:05:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7c0U0el7CgdNPhWtyjX2SWpWTkgYWLv+NTjUPMy53W2EXJIsSQYMXP0d6DLTgst8MJ8KIp X-Received: by 2002:aca:1011:0:b0:39b:a87f:91e8 with SMTP id 17-20020aca1011000000b0039ba87f91e8mr12480551oiq.45.1688483107511; Tue, 04 Jul 2023 08:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688483107; cv=none; d=google.com; s=arc-20160816; b=mNMcvdIqpZltQVuEGf0B9wYL6WjQGoHosIONJN/uX8utnD7+2MxOMW0Uvl9STCQ34N nejIO8DpkxGplhq54blyz0hWP36cIcWYL693AqFkCHReLSYfWfvrVpenG/SQn1MmFyIT Xs8qm4RNUtJvrF2XcVAwrbtBC5qA/b6b33DPO5h1bYQ3NRvuv9HHzY4k/onvlLXkyVoN xml+tb/Ei3s1jTY7O+2G5/pSQ9SWD3jA5HOKQGaoM120yWnzFhAubyLQcPcJ7xNxUAbH erzuSZYfaZj3bUrMrHRojQE6ceRdSHsc0rMPE5sKOSdNUt0n4KXS4AtGl87p8EU0lpPN +uQQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=AF17IbQd8ZxHv7cFvNY+odT1eF0QJFR1h0MLd8BIYjc=; fh=EulU3DhBB0wbkXY5V8FJUcwTcBgLSkoDZvxtjPljDBc=; b=hSbtfxXWzlz7rWx4EkGn97jnnr7R0HqBwmkwwHNarjvEq8NDO8b9NvbXOp9uv8fP8p Ftl0A5i1BaDefzOOKcKIpAI+Dd5i//JcTC77uCf51dLh27UEldi7d6zAz/HHYOIKsoTj eht+X4JBgto5Nv3mAZObsotaStcaVJrt1Ubnu6oHXLD/lFtDwUKRV2p0bjdOqCtlsQOR zkJxGUUlknKCEYCmXWSZSc9lwxab+ddsy8ntzujb62YBGbNcqDlz0xwEAVATV/OHTh++ YxpbVJoMuqRFjT+i/MhFM3af4NJ/gV5tV2BMP6lKk2V8opbnsp+5gJNeiEyBZ6Q6Zn3y H1Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=G2VE6fm0; 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 s8-20020a05680810c800b003a36545ef49si6975456ois.292.2023.07.04.08.04.42; Tue, 04 Jul 2023 08:05:07 -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=G2VE6fm0; 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 S231888AbjGDOi3 (ORCPT + 99 others); Tue, 4 Jul 2023 10:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbjGDOiZ (ORCPT ); Tue, 4 Jul 2023 10:38:25 -0400 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B31E10C3; Tue, 4 Jul 2023 07:38:20 -0700 (PDT) Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6b5ef64bca6so4984505a34.3; Tue, 04 Jul 2023 07:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688481499; x=1691073499; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=AF17IbQd8ZxHv7cFvNY+odT1eF0QJFR1h0MLd8BIYjc=; b=G2VE6fm00EqQKlsyVd2xRtU0thb2VUFW9Cp7ckYKcedpsaiaO/kJGhu2TcW9BR0gg0 hbug9YpxF3kmBEV4rbKlgS5a3AyEwBKV66bdb4tDBEHtEax7w2jCbEyVrmVnGduAS/qd 11GwlsZjBmlMvFH9pf7snQyNdhJH/kE+qzTe/mzoo98HVFPyY4ZHcTViX/4bIlhDfxlU H2lrm6mEmG+WuW9EEBHOgQZiP6F0uXoK9nBu91alCyGWmQwz52RPle/pFb7EW9qM2o5I mDCPh2SYU9yjQrW6RndJm/7ncbV0GWPy+fOpshMH8IXfR4VJWQptEu0v39z7E3bsdfbF rFsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688481499; x=1691073499; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AF17IbQd8ZxHv7cFvNY+odT1eF0QJFR1h0MLd8BIYjc=; b=iEd2rPWUwlJI/We8TSRbcItZ1/DivtcQLopxPgAGHIiUY3x3MSqgPc0JCskdP1fffB lGlcnALiF2ni+xaumoLyHsl1urHfHgBRJRdUDenZISBlsIXI07KW9yG051TNleZdR2de mymcswP5580ghq9QAFZuQmGu/wtyZBS9BdbilQjvRS1WM3meSNxfRf6vvQr0v8sxJRoO nFEn7SgYoJIyOV8NIIJ5fKqVKXks79hrmw2U+f3wqSHU20Rx8Vy5hl87JWuzR+o6hST/ /E9gpP7NXu+8gE8gff7oO7OhumCBCL6c7iktb986BVJoA/RgHTc3jcKxzhmpvZZRwDpM SNbA== X-Gm-Message-State: AC+VfDyDY5pi/i1zHT43Xuhr9joytZpJurVFxLg7ZHYkCXliEDnjIa3d 1C3RPjN2Qeioc9OHS56LN58= X-Received: by 2002:aca:d19:0:b0:396:4977:e148 with SMTP id 25-20020aca0d19000000b003964977e148mr12199716oin.9.1688481499354; Tue, 04 Jul 2023 07:38:19 -0700 (PDT) Received: from yoga ([2400:1f00:13:4ede:ce27:3b63:fdb3:caf6]) by smtp.gmail.com with ESMTPSA id b13-20020aa7870d000000b0067a1f4f4f7dsm12978864pfo.169.2023.07.04.07.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 07:38:18 -0700 (PDT) From: Anup Sharma X-Google-Original-From: Anup Sharma Date: Tue, 4 Jul 2023 20:08:11 +0530 To: Adrian Hunter Cc: Namhyung Kim , Anup Sharma , Ian Rogers , linux-perf-users@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , linux-kernel@vger.kernel.org Subject: Re: [RFC] Adding Support for Firefox's Gecko Profile Format Message-ID: References: <287bf3c8-fa0e-8c36-df14-7d728c63c265@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <287bf3c8-fa0e-8c36-df14-7d728c63c265@intel.com> 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 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 On Thu, Jun 29, 2023 at 09:35:22AM +0300, Adrian Hunter wrote: > On 29/06/23 09:26, Namhyung Kim wrote: > > Hi Anup, > > > > On Wed, Jun 28, 2023 at 1:11 PM Anup Sharma wrote: > >> > >> On Wed, Jun 14, 2023 at 01:17:52PM -0700, Ian Rogers wrote: > >>> On Wed, Jun 14, 2023 at 1:14 PM Anup Sharma wrote: > >>>> > >>>> On Thu, Jun 08, 2023 at 06:23:49PM +0530, Anup Sharma wrote: > >>>> I wanted to take a moment to provide you with an update on the progress > >>>> of our Firefox Gecko converter work. While I must emphasize that the code > >>>> I'm sharing is not the final version, I wanted to share the advancements > >>>> I have made thus far. > >>>> > >>>> This script can generate a JSON format from the output of the "perf script" command. > >>>> I attempted to load this JSON file into profile.firefox.com, and although it > >>>> successfully loaded, the call tree are not visible. I'm certain this issue > >>>> is related to the format of the JSON file or if there is another underlying > >>>> cause. I will continue investigating to determine the cause of this problem. > >>> > >>> Great Anup, progress can be frustrating slow at first but it is a good > >>> milestone to be generating output and having firefox profiler consume > >>> it. You can open up the JavaScript console for the firefox profiler > >>> and it will give some debug output. This should hopefully help you > >>> make progress. > >> > >> This week I tried playing with perf-script-python, the first challenge was > >> figuring out how to parse the data coming from the process_events. > >> Understanding the structure and extracting the necessary information > >> proved to be more complex than anticipated. This required me to spend > >> a significant amount of time researching and experimenting with different > >> parsing techniques. > > > > I'm not sure what kind of parsing you meant. IIRC the sample data is > > in a dict and all the information should be available there. Maybe we > > missed some new sample data types though. > > Most data is there. There are existing scripts in > tools/perf/scripts/python/ for reference. > > There is also the dlfilter API: > > https://perf.wiki.kernel.org/index.php/Latest_Manual_Page_of_perf-dlfilter.1 > Hello everyone, I hope you're all doing well. I have been working on the using process_events function and have made progress in developing the converter script. Currently, I am in the testing phase. However, I have encountered a problem after performing some recent compilations. I am no longer receiving the complete callchains in the output as I used to. For Example, when I ran the command perf script -F +pid, the output would include detailed information like the following example: perf-exec 132554/132554 171854.674582: 356 cycles:P: ffffffff8fab3fc6 arch_static_branch+0x6 (inlined) ffffffff8fab3fc6 static_key_false+0x6 (inlined) ffffffff8fab3fc6 native_write_msr+0x6 (/lib/modules/6.4.0-rc1/build/vmlinux) ffffffff8fa12ca5 intel_pmu_enable_all+0x15 (/lib/modules/6.4.0-rc1/build/vmlinux) However, in my current situation, the output is limited to the following: perf 108107/108107 [000] 67650.031827: 1 cycles:P: ffffffff83ab3fc4 native_write_msr+0x4 (/lib/modules/6.4.0-rc1/build/vmlinux) perf 108107/108107 [000] 67650.031832: 1 cycles:P: ffffffff83ab3fc4 native_write_msr+0x4 (/lib/modules/6.4.0-rc1/build/vmlinux) It seems to be issue in perf record. I would appreciate any suggestions or assistance in resolving this issue. Thank you all for your help. Regards, Anup > > > >> > >> The second challenge revolved around the usage of event hooks provided with the perf script > >> python event handlers. I found myself deliberating between two approaches. The first > >> approach involved creating custom functions that would be called using the event > >> handlers. These functions would then save the data in an organized format within > >> globally created data structures. The alternative approach was to write the entire > >> logic inside the event handlers themselves. > >> > >> Additionally, I contemplated whether it would be more suitable to handle the creation of > >> a Gecko format for JSON and the profile format within the same script or to separate > >> them into different scripts. > >> > >> I will discuss this points during tomorrow's office hour. > >> > >> However, I have gained a deeper understanding of the problem at hand and will use this > >> knowledge to make more informed decisions and progress more effectively in the coming weeks. > > > > Sounds like you did a good amount of research on how perf script > > works. We can talk about the details in the meeting. > > > > Thanks, > > Namhyung >