Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1070002rwb; Thu, 1 Dec 2022 11:57:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Jc1zy+OwBRIioTsZFCRlBhED7FJDKa0UoG2p+s1gPwDgaVU9ZVV0wys97ryx2K0ixKGF+ X-Received: by 2002:a17:906:b2cb:b0:7bd:4eae:9553 with SMTP id cf11-20020a170906b2cb00b007bd4eae9553mr25043377ejb.683.1669924664930; Thu, 01 Dec 2022 11:57:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669924664; cv=none; d=google.com; s=arc-20160816; b=oR8UWIbfVsi7yu0yJsq/NoudsNIFLWPAtsEWo5y0OL63d8IhOrhdtNAoO+bPwYXIV9 QMgZgRM/WTrxLxF5cDQFV6sDD1qFdLErDYWX1vp89WqNk1g5rjnKFqFQ+pz47a4KgNuL eB3BQymD1ZSboo/NndfjIEHYJWWIMQgYn5AkwdAIBzVgfeS/JLUF5xtqF5OVmfJFF0Sr 5IYmjat8tHjlI/dbIRQPjcRw4kw8Mx+VbV96fc8sN5gVgvRBvtJt2BaixQ3urMmjmXLg rXKdKY6pgFuf+/hXJEORaDni2VVKsG0goeFswHQWSqFR7Qy0fd5Hg3IiolB/qA3bijUO TLhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+xvbHrF7Tm2zAWFmetj60oSM5IBgE1cIt2lREpq6WUs=; b=Hq41FhdNeicD8hFD898MgNj4NkF0ClQdFVdqvq1V2McdANM0O3eIX/ZOASq4Q/7DT/ WQuWw1hGCIoQI0M9iOvsq1a2b0MO8cPMTTxQaB1lbSxzBOQ19K3BHG8u6HBogNlncpVK aXtcF1eSRUMydC/LqD6eQMobwzlQ5lwKx3nh+uqhh6/yhEvPE4VKq2HmBhMNYHNbAPmo Puy2b1LUvPTgjbpf7h1X1AysXyaPwRw4Ca8mw/JOPliHqlpiuS+3XJRi9/F4oXQgieIA W58t67EmR6BX480zvCIMvSBf8Zu/Iv7t64NONa4QEVdIM4SgDezCDzXYdr57Zvz+IkB3 FaVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qszaC5cV; 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 k14-20020a170906a38e00b007c0a7286cbesi2739648ejz.708.2022.12.01.11.57.24; Thu, 01 Dec 2022 11:57:44 -0800 (PST) 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=20210112 header.b=qszaC5cV; 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 S229773AbiLATgW (ORCPT + 83 others); Thu, 1 Dec 2022 14:36:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbiLATgV (ORCPT ); Thu, 1 Dec 2022 14:36:21 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C08F312B for ; Thu, 1 Dec 2022 11:36:19 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id n21so6627294ejb.9 for ; Thu, 01 Dec 2022 11:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+xvbHrF7Tm2zAWFmetj60oSM5IBgE1cIt2lREpq6WUs=; b=qszaC5cVvnw2yItPPBDvc+kowqUVvKjRJ9jwv/bmKvksaLTzFIXly+zh7JXWsa227/ L9SLd90idEW/jcJLeO/2TwYKnY7qTRHOj1BE5T5ckwtQlrbfP84r35RVp8EDNFWjSZS1 EA/Ce04CMf4hJOuaDc1HAxmaJeGlBWn7RNnKg1AR2CZaTN05emhsoR26+RS9s+tnInZz CeTNsNmz8TMrQfdUJb2nPZG21ENsxeQjmGJdNFObyvJek0fu28G7C0gOzAGDJ+iF4sOV G8gnycxWEpc0RwfLKMo7qVDejnveD6Lqb5ZjrKim4opufeLf9VlRx2bZ8y6yuHpIa9HK AULA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+xvbHrF7Tm2zAWFmetj60oSM5IBgE1cIt2lREpq6WUs=; b=P3oxnvjkAjrxFCQ1sIda/wU6bv4HDfQMtXk47NpMERilHCuAuHPryUg3ZPwvLLwLeS 9mfZtYYn8je5bJvVsuwbrUA03JN1Rvmdkq3JgK1XSFNRO6+AER8IrMRlU9Sjn3s7qBBF ZGC8zkH79D/7zxDbdxPlSqrynDO0MolyshcEZ+nYzBpJ4zH8espAD8oU1tYFKeAqFfxI qVAbbqOVgBSLXcGyCq6yyrCX43rWib5x23DBnFf5DPpI6smWbLiMbnUI7c5FE+8zkm+4 5MYn6d5l+m02NsOpuJm6gek8cmfWbdMFk6R/msZ9drQosnpjf6QxNYndVDwxZj5TTPkB dLMw== X-Gm-Message-State: ANoB5pksHxMUUThjgdX9VpTwJSBNGrw00OvzHhyPIVivzN2s8RrjhhDR 09I6+rlTNcs0CyLLWN2faebkKhEppb8cFqf5 X-Received: by 2002:a17:906:830b:b0:7bb:7dda:7d49 with SMTP id j11-20020a170906830b00b007bb7dda7d49mr31302792ejx.156.1669923378083; Thu, 01 Dec 2022 11:36:18 -0800 (PST) Received: from localhost.localdomain ([194.110.85.83]) by smtp.gmail.com with ESMTPSA id 24-20020a170906329800b007b29d292852sm2125212ejw.148.2022.12.01.11.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 11:36:17 -0800 (PST) From: Petar Gligoric To: linux-kernel@vger.kernel.org Cc: Petar Gligoric Subject: [PATCH 0/2] perf: introduce perf based task analyzer Date: Thu, 1 Dec 2022 14:35:55 -0500 Message-Id: <20221201193557.65548-1-petar.gligor@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 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_NONE,SPF_HELO_NONE,SPF_PASS 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 This patch-series introduces the task analyzer and adds the feature to output csv files for further analysis in thirds party script (e.g. pandas and friends). The task analyzer dissects recorded perf.data files based on sched:sched_switch events. It outputs useful information for the user of each task, like times between schedule in/schedule out of the same task. Switched-In Switched-Out CPU PID TID Comm Runtime Time Out-In 15576.658891407 15576.659156086 4 2412 2428 gdbus 265 1949 15576.659111320 15576.659455410 0 2412 2412 gnome-shell 344 2267 15576.659491326 15576.659506173 2 74 74 kworker/2:1 15 13145 [...] The user can modify the output to his liking and his necessity. He can either limit the output to tasks he wants or filter tasks he does not present in the output. The output can also be limited via the time or specific tasks can be highlight via colors. A combination of those options is also possible. Additionally the user can print out a summary of all tasks, which is a table of information from all tasks throughout the whole trace. Information, like total runtime, how many times the tasks have been scheduled in, what the max runtime was and when it occurred, just to name few. Summary Task Information Runtime Information PID TID Comm Runs Accumulated Mean Median Min Max Max At 14 14 ksoftirqd/0 13 334 26 15 9 127 15571.621211956 15 15 rcu_preempt 133 1778 13 13 2 33 15572.581176024 16 16 migration/0 3 49 16 13 12 24 15571.608915425 [...] The standard task as well as the summary can be printed in either nanoseconds, milliseconds or microseconds(standard). Both standard as well as summary can be saved in a user specified file in csv format. Hagen Paul Pfeifer (1): perf script: introduce task analyzer Petar Gligoric (1): perf script: task-analyzer add csv support .../scripts/python/bin/tasks-analyzer-record | 2 + .../scripts/python/bin/tasks-analyzer-report | 3 + tools/perf/scripts/python/tasks-analyzer.py | 937 ++++++++++++++++++ 3 files changed, 942 insertions(+) create mode 100755 tools/perf/scripts/python/bin/tasks-analyzer-record create mode 100755 tools/perf/scripts/python/bin/tasks-analyzer-report create mode 100755 tools/perf/scripts/python/tasks-analyzer.py -- 2.30.2