Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1750753rdg; Sat, 12 Aug 2023 15:06:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyjZBC+iuqFxk8AWYwfvsZFqOKzIwdJDovLwiNPGYmAgoLizVSiCbR8ozAxc+FKqQw1eaY X-Received: by 2002:a05:6a20:3246:b0:13e:c03a:7c5d with SMTP id hm6-20020a056a20324600b0013ec03a7c5dmr5707735pzc.8.1691877967624; Sat, 12 Aug 2023 15:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691877967; cv=none; d=google.com; s=arc-20160816; b=gP7ZZsZs8reFp2donMUP1gXXwqaZjZCpkN5fHsMZKytz7T1BYT2ubTbo6VxbDQ8EgH 5cYume5EIkseWmx28H82H43/P6M7E/MlX11Kqg+xnRw3d6BrMz5wf1jsGfRU6QCwIEjn rLDN5phQzTK/xvte7m36ZhQInjCl4vlmepFe6iQmTKd4e6XdehGKuiBg/yGcKPyKSaYz Esxan2CmCRAM9/1jlJiF/yuTbttNHN175qSlTTX8rqryif3QXWIWue9RRSSUi4+pikKF x+WgEB0CivQ95fFdYM4HcGS8I3TT8OnsgCjX3dQ9KlUNHnvUhcMBaQZCoSe6pl3puB0O JT7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=wa8XBwPigobobIYOZwDPIfHtzN+bm0HM3i60VeEtrcM=; fh=/2Pu8+Cab9DnjIMuicGq+a972c+JlSI0zVoKwyqQwrM=; b=KI/mQ814drDetP1nk6BcfGRVAZcEkx+5bDY7TmIC/J2C/mDF0Reo6UksSi01FA9yQV bKeI4HkHk+20YULzFrENzHspabEyOGUzv7y6SZbJqUd3A+0Y1Y77ASqou8EczI6iLlXF dhhy92nsEy35LgkwNB/moR5lBQoYYbWPUIL7izp5lqypmxP4zHtj7xlCfIp49XfZAq4y Y7hui2d9ciWu+lnylomwAqBOmX26AWlsg109zxLA+x3FClr8e2MhWu3bOyvsYrZaLTIc jKO05Gzdzgfhdd/d9c1wr9hKHZwmYSUYSO/Whvx7n+J2Nv937NbrOMcgqKlle52F+EgI 0czA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=prRKN05a; 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-20020a056a0026cc00b0068717825fc9si5266931pfw.405.2023.08.12.15.05.53; Sat, 12 Aug 2023 15:06: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=prRKN05a; 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 S230145AbjHLVge (ORCPT + 99 others); Sat, 12 Aug 2023 17:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjHLVgd (ORCPT ); Sat, 12 Aug 2023 17:36:33 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 217571706; Sat, 12 Aug 2023 14:36:36 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-68730bafa6bso2866339b3a.1; Sat, 12 Aug 2023 14:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691876195; x=1692480995; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=wa8XBwPigobobIYOZwDPIfHtzN+bm0HM3i60VeEtrcM=; b=prRKN05ah5mxmdwO8fMp8t30JTrbepUytiLrBxzGKQopjwdyUTITmDIJVQCvoVYXop HqYgo57kuM6ENZmTAjDseW3c4A0EjmbpLvfVD9u2zkX2jolxg0DG6MeA+GbDpjZDxNQC mw6Vsj88KeIjeBPfNtPYBJZxjdX4a/laq8RncGFDR31R8zy1dkKpafPOEMLX/nW2c/WD Clfh+/cy9NQNZncO5ZOjYUeIerP35iTIyB6hBYgYKMvH1LbXimGalKuPP+8922m2xGV3 K1txPKxpHzW2HpYTaKrp45sx5jb0CvVv/bjSsBZYZU9F8jHFIk77M1FpAv9S/bjZziOQ 4rmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691876195; x=1692480995; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wa8XBwPigobobIYOZwDPIfHtzN+bm0HM3i60VeEtrcM=; b=Vwppb5GhaPu1dODd8N1DgEAEhITbbqJ3BvnNjnm88Jqi/rfbehAilDL1CxqUUSqsLl M5bgFNISss/4zWqh5YOrDj5/Cgog5+Hxq/v8q2SDMUBpMfn3FrwDrcJas+nlUZlU3FT2 dKDBms3yPFrxEtIgnSEsFfshNeL7jEk2o01Lnmnlw9HTkcuQtQ8zuFQKMzXQtARBFlPR 2rPBU5I3MAsRX/UGXIQv/eNQMVZWrzTiAoYZm8k7uYQC9VEHOBSQRG93ibO00K7nD8ue 2MJ5oh/ybgEkp7J/agJa8wkvc/pfsrf+4fuJ5U03PN190tEPOkInGoe7p4VW7Solp36d 2T0Q== X-Gm-Message-State: AOJu0Yzqz2nLqnGXeiectUNaUJt2tzF5Y+sV+8ZAdSxupzok8RWa68la eHEGrmVQCjgh4mWJiRKwc94= X-Received: by 2002:a05:6a20:8422:b0:13e:debc:3648 with SMTP id c34-20020a056a20842200b0013edebc3648mr10893039pzd.29.1691876195351; Sat, 12 Aug 2023 14:36:35 -0700 (PDT) Received: from yoga ([2400:1f00:13:dd22:5ae5:bc57:c1e5:1a03]) by smtp.gmail.com with ESMTPSA id w20-20020a637b14000000b0055fd10306a2sm5674478pgc.75.2023.08.12.14.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Aug 2023 14:36:34 -0700 (PDT) Date: Sun, 13 Aug 2023 03:06:27 +0530 From: Anup Sharma To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Ingo Molnar , =?utf-8?B?wqA=?= 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: [RFC PATCH] perf scripts python: Add support for input args in gecko script Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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,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 Refines the argument handling mechanism in the "gecko-report" script to enable better compatibility and improved user experience. The script now differentiates between scenarios where arguments are provided for record and report cases where gecko.py arguments are passed. Signed-off-by: Anup Sharma --- Hi Arnaldo, Thanks for providing such a detail insights here: https://lore.kernel.org/linux-perf-users/ZMJaDGhSnhIlK3Nd@kernel.org/ I've successfully confirmed that the command "perf script gecko -a sleep 1" is functioning as expected. However, I encountered an issue when attempting to provide arguments such as "--user-color" and "--save-only" to the "gecko.py" script while using the "perf script gecko" or "perf script report gecko" commands. In order to understand the inner workings of how these commands are executed, I delved into the "buildin-script.c" code. From my investigation, it seems that the arguments are taken into account for the "record" functionality, rather than for "report." To address thisĀ  I added this changes. I've also documented the usage of this command in our wiki: https://perf.wiki.kernel.org/index.php/Tutorial#Firefox_Profiler For most cases where users do not require specific "gecko.py" arguments, the command "perf script gecko -a sleep 0.5" is sufficient. However, if users intend to provide particular arguments to "gecko.py," they should employ the command "perf script report gecko --save-only=cloud_cpu.json." I believe there might be an intelligent solution to streamline this process. Therefore, I would greatly appreciate your insights on this matter. --- tools/perf/scripts/python/bin/gecko-report | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 tools/perf/scripts/python/bin/gecko-report diff --git a/tools/perf/scripts/python/bin/gecko-report b/tools/perf/scripts/python/bin/gecko-report old mode 100644 new mode 100755 index 0c12cc08f3ab..1867ec8d9757 --- a/tools/perf/scripts/python/bin/gecko-report +++ b/tools/perf/scripts/python/bin/gecko-report @@ -1,3 +1,7 @@ #!/bin/bash # description: create firefox gecko profile json format from perf.data -perf script "$@" -s "$PERF_EXEC_PATH"/scripts/python/gecko.py +if [ "$*" = "-i -" ]; then +perf script -s "$PERF_EXEC_PATH"/scripts/python/gecko.py +else +perf script -s "$PERF_EXEC_PATH"/scripts/python/gecko.py -- "$@" +fi -- 2.34.1