Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC0D7EB64DD for ; Sun, 13 Aug 2023 11:55:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7F85C86918; Sun, 13 Aug 2023 13:54:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BwLdE18f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7D67582BBF; Sun, 13 Aug 2023 07:18:07 +0200 (CEST) Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 602F8807B4 for ; Sun, 13 Aug 2023 07:18:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=puh4n.zhou@gmail.com Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bbff6b2679so21627235ad.1 for ; Sat, 12 Aug 2023 22:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691903884; x=1692508684; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=a9/4SmeSa0uRocpKUqf7iHN90BhZu7d4+JLnSXAFAew=; b=BwLdE18f61UZLt8UfsP4hQMfHhnstjGgiWPQmcpLPSe4viopJ507AWMNOiru0IIe++ rWJ6GgNG3oNPhCeaj1aXspYnzOdKdRU6gxyCt0PLnl/JJPD4vB7npxnRWx6Aa2/XZ+bM PnT0zCweYMKZ0BKDupyglozfQcWnP2jbOOEKpOVy/jdaqMBz9aQgcnbpZoN+PT3kKWLX vEBxH5IoY9IW9I5nvDMu+j+DYPfif6h12aDwcWNQj756emGEG+63/0hSsKvJD4bh6LRC 7LD5ledZPwBvxK8qhabfCKV46tfDdrS8/dvgSzr7jCmVe1Wbn8/5r5b3um+9bho1gGvO VDDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691903884; x=1692508684; 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=a9/4SmeSa0uRocpKUqf7iHN90BhZu7d4+JLnSXAFAew=; b=U6Mh62QOUxAr8gR+GkGOWu849q7QGZ4NXbsmexmUFsRNX25s9BNn2cfeoMHOVDKhNY L2+wovXfFx5WRK2+jcdRPfw6C7U34U35VW9e/OkwwcbfIECYocTP9sUp8ZbECpshHb/H qjNeD/samL82W3K/tjPoeW5h3gegkU9tdl/hRrUylVY0q3/uL/z8WWyz6XWr9CJxfkrO pH1HSexNUtbRtNNlMdqfRJym/CD39CJEQKs8lTPt40yxFnAJ8sYsC1azpVsXrRDGN/1k aqKMPYL69jET1s761o7DYQNMMZNkDlzPyaHU3XAkSIMOJbIKEWDH4NAptP+cbQQd3w5+ MO+w== X-Gm-Message-State: AOJu0YwHUXRwNJYTkv0rfwKmwOmV6aTKNqzmjUvYumH8tyu4svDUc8t9 9IqqjVFyjatlTIH+aBXHf/M= X-Google-Smtp-Source: AGHT+IFWdT+C6jyKBNxwfeHOlieGxlCyAIGz7CmF0pNy/VJH3txRpcnVz+rDK+wPxKZMOrVOf7GB4w== X-Received: by 2002:a17:902:7405:b0:1b8:525a:f685 with SMTP id g5-20020a170902740500b001b8525af685mr5096070pll.37.1691903883595; Sat, 12 Aug 2023 22:18:03 -0700 (PDT) Received: from localhost.localdomain ([20.187.114.20]) by smtp.gmail.com with ESMTPSA id p2-20020a170902e74200b001b86e17ecacsm6708995plf.131.2023.08.12.22.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Aug 2023 22:18:03 -0700 (PDT) From: Puhan Zhou To: sjg@chromium.org, u-boot@lists.denx.de Cc: Puhan Zhou Subject: [PATCH] docs: fix wrong usage of proftool Date: Sun, 13 Aug 2023 13:16:19 +0800 Message-Id: <20230813051619.36937-1-puh4n.zhou@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 13 Aug 2023 13:54:59 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The usage of proftool in docs is incorrect. If proftool is used without '-o' argument, it will show the usage like following $ ./sandbox/tools/proftool -m sandbox/System.map -t trace -f funcgraph dump-ftrace >trace.dat Must provide trace data, System.map file and output file Usage: proftool [-cmtv] Change '>' to '-o' to fix it. Signed-off-by: Puhan Zhou --- doc/develop/trace.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/develop/trace.rst b/doc/develop/trace.rst index 9bbe1345d2..546862020b 100644 --- a/doc/develop/trace.rst +++ b/doc/develop/trace.rst @@ -139,7 +139,7 @@ There is a -f option available to select a function graph: .. code-block:: console - $ ./sandbox/tools/proftool -m sandbox/System.map -t trace -f funcgraph dump-ftrace >trace.dat + $ ./sandbox/tools/proftool -m sandbox/System.map -t trace -f funcgraph dump-ftrace -o trace.dat Again, you can use kernelshark or trace-cmd to look at the output. In this case you will see the time taken by each function shown against its exit record. @@ -171,7 +171,7 @@ command: .. code-block:: console - $ ./sandbox/tools/proftool -m sandbox/System.map -t trace dump-flamegraph >trace.fg + $ ./sandbox/tools/proftool -m sandbox/System.map -t trace dump-flamegraph -o trace.fg $ flamegraph.pl trace.fg >trace.svg You can load the .svg file into a viewer. If you use Chrome (and some other @@ -191,7 +191,7 @@ spend in each call stack: .. code-block:: console - $ ./sandbox/tools/proftool -m sandbox/System.map -t trace dump-flamegraph -f timing >trace.fg + $ ./sandbox/tools/proftool -m sandbox/System.map -t trace dump-flamegraph -f timing -o trace.fg $ flamegraph.pl trace.fg >trace.svg Note that trace collection does slow down execution so the timings will be -- 2.34.1