From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0042.outbound.protection.outlook.com [104.47.37.42]) by dpdk.org (Postfix) with ESMTP id D10071E33 for ; Tue, 8 Nov 2016 04:33:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ROhPUf5KT/HJppo9RBqldeUiPcYl7fb93RB9iRQ0hx8=; b=Zsc+UCFlJJ11MDx2rlv5zsLTvsNnRoraq0aQlM2zkTkZMw0kkVj5D1ztT9gfpuBxdlrIWg8E7pU7AGeArF+4yTDNUt9tkoq1uOJ+8ztpif1PST3cu9RJMcmsD5nkDuOVBf+6/L3JNv3T9rzeUaQoNCTgHIaV4LAw0RDPTwCaPKg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (122.171.202.234) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6; Tue, 8 Nov 2016 03:33:34 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob Date: Tue, 8 Nov 2016 09:02:56 +0530 Message-ID: <1478575976-12006-1-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1475657009-11139-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1475657009-11139-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.171.202.234] X-ClientProxiedBy: PN1PR01CA0053.INDPRD01.PROD.OUTLOOK.COM (10.164.136.153) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: 689467fe-b799-4ec7-9343-08d407880649 X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 2:eDoMvGIuucOhzf8wRV/R2AMMhXJaJsT6Fd6NW+L+FtoTaagGi0Fzl2mAjHiuZWWR1Trl5F/fLqWcAwucHSfheGk50bukQIDqulEYL+RrYV4NUcd8R1KQz/lnIMJ37E0eVVFft6GfdmV7u2RfIiJsBvpWg1wQa/8tRuUmUjIQ7VnMEyHXpoAFFwVvi7bO/7OYVQI6OWFiFUqVYzt9l2evhg==; 3:KXwRL9Nowoa7Tuluq0GnnYBjbiTw7dtJwsFOG7fMtYkHNs699XKjn0pjdPC1WP4AfquFlqywym47lE9/MazrAAU8BLnuKVC87hFV6IeR2axUeLKZOKz8KJPvDP3qJnLJ0ydbrQfGRg59x6VGaxO48Q== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 25:E+7XufNCsNJUPwTqgWuALts5LsvGK6zlq/CwBYCycC5d5TlDeN49sMjx6WTC38zDai9DcEjNfZXbs6GxSeNF7nF0qUU5g3sYheTaAQvvVvyVRwDIjGF8ycdgB1DBdP+ZSnEkhFSK6UyKGHpFE9xq6V1TfLw7CQK1aHTMe8XIcY0Jxj6kwnCrmxmq9UTIzpETA8aPPudy7SQp6F49150pREtGiBhGZs5WQNTxl5kAA+aIYF3TN83ZpDDUPTgvdUEDBaJpyQF01c8SroceI/WJC7eXDfp0dnb7weNWRvU0Fj6htuYboRPLdgM0iNmDyK18P+6W77kKVpYu6y688FjMSHL0gd5EKC87vlOL6f5jIaZBOcuL6mqODYe4VUCxpFoFwXPBtVCOgygiD3VEPmGsJ8gbhsR6xdSx/lMz1qcA9MlkIH86EgnJHTex5H7hEwQgR5vZ8r0UWl4vGvOOUhCfegXcAvdcsXIUfIoZmA7369LShi5e4T5wfupUs/nDPGuhBTIXqXo9MXWDQgW95hGI6RqPPqIDMWdlou4OGokUswSH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+uUqsQtdhfkqb+AZljjIJMkZgh3TjOsz+ksPKquojLeL1bIBmTcoodE/cAF0kVlSEBHDCPhJXQLpQxs2QiILpPEbcxNje9qiLpVI6nZMIsIczmW7Dz6wQgOnjP7cvTZT5txk50xZqJbDbSSOmi0eyeYbKeZBXE/qnyMZ2iV8BR5kwwQjuuig= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(278428928389397)(108984395545644)(166708455590820)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:5nUHdd1+36IujAl+OwpNDX7HItykUYgD+Hg1+hFgBt8MX/6Ge1gfB/wDPDWtKJqGm6jN2yblXwIqKBGO956Y0QsF0ArQJgZUKsflsynJAFZfdM958qc9h4+fHLL5q5EO8YJVe5TWrwiOd0XO4CjnJfk0CAECJJAr2MQkAnOAau6c9Gc2TOYUxJLO2CPw+OcBVrsBXNJ/dMVJX9Rp2MBdmqJDWA2by4Is8BbLSPD4b75Jyt+oVOkKVX+dpGxquPnZXKSCCFDfbUMrEaGou/Yz+MwJaySIbLc0fqCen3k0c8lDSuZ6j3wpBCnq7Ko3EdfC6K3gW9IiXW4oB/Tsg4TA5v3ESc0NbPjE/XRbHfc0czdcGJEXFmKdnJ4Ny4BJIv88kQT+X1UWEOmRE3Q9k5pMd8aw7oZidXwn1JtXaRvUWBK9jgDq6RFkpLlw1/ky5Hj79mcirqKusFeaeMcaNLO/QPFoMhqDJkT+s0XAaPL08UwO3GCAUVKeCRdqDkK/piv3TdmSG+1I93O2fPbyvjABOJW1qopq6IIxxydpIyBEYEXUsFA7DOPIu+bB08rrYrR/E4Gvf+rwQJIJ7fRQFoTRFQ== X-Forefront-PRVS: 01208B1E18 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(229853001)(42186005)(6916009)(101416001)(5003940100001)(5660300001)(107886002)(68736007)(47776003)(105586002)(50986999)(77096005)(42882006)(76176999)(2906002)(50466002)(81166006)(586003)(4001430100002)(97736004)(36756003)(6666003)(2950100002)(92566002)(8676002)(6116002)(50226002)(110136003)(48376002)(3846002)(189998001)(33646002)(66066001)(4326007)(81156014)(305945005)(7846002)(106356001)(15395725005)(7736002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:pivKlEJ+8sy9HpL076sT4FVT8OpSOjZKRj19UTi?= =?us-ascii?Q?0g5qc56TgtVVIbT1vMdpIPtF54KJc3QmDhMRctdmC1q2ysOufqxB/YgF44cd?= =?us-ascii?Q?z8pXz9z7QvS1ahFQomte4BkxFU0pJ+jFH+zi0sl7Mb0gjM9VOUu0Evemq0EP?= =?us-ascii?Q?4iQwgdLuZPBK+9b4xVxF9ra8biXa/yCpRUKlmiVtoENyk7LzdAB7ltzOxjHq?= =?us-ascii?Q?HYo+CfO7amnXMBlD9pUi8mX/ghcI76SpJimD477wSBv/tiEP8QoTZvo7PKHb?= =?us-ascii?Q?mzQmuZNnuIDIXz5ej1lN6lmT7h0ubelu/FxG0GhtS4IWgBxe4azG5K4rAQZz?= =?us-ascii?Q?BP+1OAqMkcB0zkTQMqmkgvU4W2Wxy6W/NIR0eANLzmDjbHnNir+yp5ZcYYc4?= =?us-ascii?Q?p2AqHAuXY4JP22825cwa3O584sdFZe5+BGajd1QYY89vmKa11TQVNGFlmSSG?= =?us-ascii?Q?T5JPdqBfsJGNN5cURAy7+qj7nfAfDASEipbLTOMJL4GzAL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npa7Ru0Y+8QnX7u7X7YXnOiJuiMmUDnuBBVW+8ESY58rqoYIzIBVaqV47MKGMn0xVkGrLbd9FfNk60w4/AUbtMZDvEaRMl7/28le+4r0Q+rROGJmchd9cTwArgb8RztQccBdWhqKlyw9HZoIg; 5:4wkKfb9jqPeu1wMRkFTqe314NA77U7RIhlG7bQvmbTTekAbpQHGHwSfq6HjF8V4qhQ1IUKkohQ8npgI5cde7Ljo8jVyMjiSVbtza9L4lNQnDOfEWH+jMtFydIOmorrUnXGXttZi4ddQXecMOwlpX7g==; 24:AGvum5Y15c2ikWvPCauFsfxbBrUOmDmoH8Q9o2m31omK+VB/C2o0xRgWq1tc3sLp0qh4ampYVcgrm5FjWRgu3kdlLAeGb4eLDdISriWIqbI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:EaS6zfgYEXWIndBQJfIgRWdMFOiSwZW+Jx21dCTnRgJqhpCWLlGOSpOX0LURhDGD5B3EvAeDP5gTQ2z0nTdF3esvRt6xVKUhlTAx8PvEUYTBeAT+VGXR8fHozIUYW0QHbXxq3Tt29jepi9VG0+dY5sxaDuFMSDTbD6Ge2MYE/D2mF2FCtri/744aWyhqRUKSdjLA7BjcvPQHfaMEg8mRpY5ce+Q6DQZz2fKcf81RGfp1Ck3kS67Roe4HErhUgYg7hWLQAMdfV4Yc0mrGHY4ZUXF0RXJHvoGV96B+FltgYzL0H3C4owP8mhVgTPSFsEiTUc6ag/EKfnw6DET2oKbW2QyWAMBEp7BB9u+qoC3EmHg= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2016 03:33:34.6264 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH v3] doc: arm64: document DPDK application profiling methods X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 03:33:40 -0000 Signed-off-by: Jerin Jacob Signed-off-by: John McNamara --- v3: Fixed formatting issues: - Remove the introduction heading and put intro text under the main heading(Thomas) - Fixed RST formatting issues such as enclosing technical terms in backquotes(John) Thanks, John for providing the updated version v2: -Addressed ARM64 specific review comments(Suggested by Thomas) http://dpdk.org/dev/patchwork/patch/16362/ --- doc/guides/prog_guide/profile_app.rst | 64 ++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/doc/guides/prog_guide/profile_app.rst b/doc/guides/prog_guide/profile_app.rst index 3226187..54b546a 100644 --- a/doc/guides/prog_guide/profile_app.rst +++ b/doc/guides/prog_guide/profile_app.rst @@ -31,8 +31,15 @@ Profile Your Application ======================== +The following sections describe methods of profiling DPDK applications on +different architectures. + + +Profiling on x86 +---------------- + Intel processors provide performance counters to monitor events. -Some tools provided by Intel can be used to profile and benchmark an application. +Some tools provided by Intel, such as VTune, can be used to profile and benchmark an application. See the *VTune Performance Analyzer Essentials* publication from Intel Press for more information. For a DPDK application, this can be done in a Linux* application environment only. @@ -50,3 +57,58 @@ The main situations that should be monitored through event counters are: Refer to the `Intel Performance Analysis Guide `_ for details about application profiling. + + +Profiling on ARM64 +------------------ + +Using Linux perf +~~~~~~~~~~~~~~~~ + +The ARM64 architecture provide performance counters to monitor events. The +Linux ``perf`` tool can be used to profile and benchmark an application. In +addition to the standard events, ``perf`` can be used to profile arm64 +specific PMU (Performance Monitor Unit) events through raw events (``-e`` +``-rXX``). + +For more derails refer to the +`ARM64 specific PMU events enumeration `_. + + +High-resolution cycle counter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The default ``cntvct_el0`` based ``rte_rdtsc()`` provides a portable means to +get a wall clock counter in user space. Typically it runs at <= 100MHz. + +The alternative method to enable ``rte_rdtsc()`` for a high resolution wall +clock counter is through the armv8 PMU subsystem. The PMU cycle counter runs +at CPU frequency. However, access to the PMU cycle counter from user space is +not enabled by default in the arm64 linux kernel. It is possible to enable +cycle counter for user space access by configuring the PMU from the privileged +mode (kernel space). + +By default the ``rte_rdtsc()`` implementation uses a portable ``cntvct_el0`` +scheme. Application can choose the PMU based implementation with +``CONFIG_RTE_ARM_EAL_RDTSC_USE_PMU``. + +The example below shows the steps to configure the PMU based cycle counter on +an armv8 machine. + +.. code-block:: console + + git clone https://github.com/jerinjacobk/armv8_pmu_cycle_counter_el0 + cd armv8_pmu_cycle_counter_el0 + make + sudo insmod pmu_el0_cycle_counter.ko + cd $DPDK_DIR + make config T=arm64-armv8a-linuxapp-gcc + echo "CONFIG_RTE_ARM_EAL_RDTSC_USE_PMU=y" >> build/.config + make + +.. warning:: + + The PMU based scheme is useful for high accuracy performance profiling with + ``rte_rdtsc()``. However, this method can not be used in conjunction with + Linux userspace profiling tools like ``perf`` as this scheme alters the PMU + registers state. -- 2.5.5