From patchwork Mon Nov 28 16:47:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 1709885 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=jMwCJ293; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NLWcj1Nqpz23p2 for ; Tue, 29 Nov 2022 03:48:20 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ozhIY-0006Wn-0q; Mon, 28 Nov 2022 16:48:02 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ozhIU-0006VY-UW for kernel-team@lists.ubuntu.com; Mon, 28 Nov 2022 16:47:58 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 948E83F04C for ; Mon, 28 Nov 2022 16:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669654078; bh=OIlBEdL75iptek8BQwD0FFBhj+mLJEaA+EMrrb61Jyc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jMwCJ293qCW0nVpa3tvuCe2ao16RqwcVJ9l1bk08x3wRuWd+cj1phJiW3tSEODKEg PHglE5Tn5qvqpl8GOzlcahpPudIbibuOxhdr545j6xNoYFKC0HKVEsaC9eNfdcgji6 hu7oXfkE2f/1UkkjDK4Bncidp8w8MjdCDZUmygod3CEEHiHu8YwcldmF65g8YG0pEj rX5p+polugKCZBW5+rJIsgxBJ30o48IZ9SHCb4xmji1F5/hG1BKUhAtScs8d/IJ4Jn qyyg2wckIcbLLM5XBjpzj17XAOKEDS3vy/xDhPS2CbHHRo462SK3qgMMwireJvR2OR Ihr7vS+MpZ8gA== Received: by mail-wm1-f70.google.com with SMTP id v125-20020a1cac83000000b003cfa148576dso6510905wme.3 for ; Mon, 28 Nov 2022 08:47:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OIlBEdL75iptek8BQwD0FFBhj+mLJEaA+EMrrb61Jyc=; b=WCX2lhLKurg9G8772iVTM6qIW1h+tIKBzaucgKRQ7bqbrE/j6bCHe025bJKs6lF9tO CczUUdxNHNFxKIjsvkyKPuG0yqPlKo8NlHsYqjz8ayKCS6QPkGPMy7fSAi+OTbkwTB9h FefSAt8lGq5sR18d6FZHcnGO5wIS6uKDZqxSOXHL6Lot9RyP7Ty5VuAA/n66BGigBhbG CfO5uApUWf+2+mo1NKaxlbioL08UumX6FFQYF3JvRyK+ZkV3AKHugl4kcyDTovJeI5hD zjBHFOciumueBgAoZvZ+3U18LvoHHF+VyXgPojKNw+vYOstPi+Ej7PXnQRctHtTjfc/e XDgw== X-Gm-Message-State: ANoB5pnE7Ze7L+Az2SSn1FS2kJDHjqCqynRlaqZVz6nuGz0CIpxXAkBv iimxia5feHpxpqjbDQT5LPJlh9QybfrL9m9aLIbmqiiNAutC5zufKY3g4dddRAfOngQL1sqgxGJ 4KOzwMgFjjke7R0A2XrSR9WRm5ddffJFKNK8Epqv6Yw== X-Received: by 2002:a05:6000:1b86:b0:241:9606:1123 with SMTP id r6-20020a0560001b8600b0024196061123mr26551506wru.537.1669654078041; Mon, 28 Nov 2022 08:47:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6OBiZgEwQtnjABMENQNyAl33SQT5CcwdFAqNOm3KuZspcjZDbUGFng+LTuXqDJ+xovT0Ragg== X-Received: by 2002:a05:6000:1b86:b0:241:9606:1123 with SMTP id r6-20020a0560001b8600b0024196061123mr26551497wru.537.1669654077834; Mon, 28 Nov 2022 08:47:57 -0800 (PST) Received: from canonical.com (net-93-65-52-3.cust.vodafonedsl.it. [93.65.52.3]) by smtp.gmail.com with ESMTPSA id k1-20020a7bc401000000b003cfbe1da539sm15480403wmi.36.2022.11.28.08.47.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 08:47:57 -0800 (PST) From: Paolo Pisati To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/8] Documentation: amd-pstate: add tracer tool introduction Date: Mon, 28 Nov 2022 17:47:48 +0100 Message-Id: <20221128164755.368178-2-paolo.pisati@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128164755.368178-1-paolo.pisati@canonical.com> References: <20221128164755.368178-1-paolo.pisati@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Jinzhou Su BugLink: https://bugs.launchpad.net/bugs/1998106 Add amd pstate tracer tool introduction Signed-off-by: Jinzhou Su Reviewed-by: Huang Rui Signed-off-by: Rafael J. Wysocki (cherry picked from commit b020771a66e474cd8450b3c483cec8492702db22) Signed-off-by: Paolo Pisati --- Documentation/admin-guide/pm/amd-pstate.rst | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 2f066df4ee9c..1923cb25073b 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -369,6 +369,32 @@ governor (for the policies it is attached to), or by the ``CPUFreq`` core (for t policies with other scaling governors). +Tracer Tool +------------- + +``amd_pstate_tracer.py`` can record and parse ``amd-pstate`` trace log, then +generate performance plots. This utility can be used to debug and tune the +performance of ``amd-pstate`` driver. The tracer tool needs to import intel +pstate tracer. + +Tracer tool located in ``linux/tools/power/x86/amd_pstate_tracer``. It can be +used in two ways. If trace file is available, then directly parse the file +with command :: + + ./amd_pstate_trace.py [-c cpus] -t -n + +Or generate trace file with root privilege, then parse and plot with command :: + + sudo ./amd_pstate_trace.py [-c cpus] -n -i [-m kbytes] + +The test result can be found in ``results/test_name``. Following is the example +about part of the output. :: + + common_cpu common_secs common_usecs min_perf des_perf max_perf freq mperf apef tsc load duration_ms sample_num elapsed_time common_comm + CPU_005 712 116384 39 49 166 0.7565 9645075 2214891 38431470 25.1 11.646 469 2.496 kworker/5:0-40 + CPU_006 712 116408 39 49 166 0.6769 8950227 1839034 37192089 24.06 11.272 470 2.496 kworker/6:0-1264 + + Reference ===========