From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7601245E21; Tue, 3 Dec 2024 22:39:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08CC140261; Tue, 3 Dec 2024 22:39:40 +0100 (CET) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTP id 0544B4025D for ; Tue, 3 Dec 2024 22:39:38 +0100 (CET) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-7fc22a88bcbso4605066a12.2 for ; Tue, 03 Dec 2024 13:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1733261978; x=1733866778; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=HE/eOfAl6l1gdnwH5C5reTKOaaU41t+FetqQ3nROHj4=; b=YW3nPCU9ZphJYydxsu3VMEeku1DWBg0H0SQDCsU9uK9TbIlpcY9CA0+iUzLUeLG8cD fArDbO04K3FikSwN5hO5woW8NS7aqktHTTs5uovarwGMpmuOfY2Hy2XQ6iKyCKV/9QX7 CmziWJe02/Wysq0lIXFRvmCmzgXyBSEOh5qCvfsH3yLucPIEk2CzJhHZKccM2+tcR5ry JMjHIggYMU5HTvU9grzS5n99urB4pVijDgbksmtQPWiATiYuTzFCn0kHecRbkiN1bSj/ f9Nt1TLTc7CI7uvnV2CwY+Sekhk34gSbqDGgY4gUm0OEsx+pkqJvOTILZxg7ig0bFSZb tWOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733261978; x=1733866778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HE/eOfAl6l1gdnwH5C5reTKOaaU41t+FetqQ3nROHj4=; b=LKz1vdIXNuXt0Yuc2tReQMGvKRBIaAdCIBkuTMngFowB0lPMu92marQFEkVxhBBwvj /QIK8D3/I2iigmydZ5Ujh0FeXhiXDSWAmWZOSODbHB6423eszQl8EwtqBjgpvaBNAahU ejncZOTL7tUb28lqkJNNqtSKiXAzJe7VSdYueXUtTYk2PI6uwyMv3vSorWxFrU65ajQv L+sTQzRWNRBidnLGIxMiC/KMhf7uSnQGo/qcc6FcgDWTLFED6EyyXWnCV7MaUro5gG24 vxmqIca21l5cYaZapmejm82i331t9ZGnVmyO3Q8JnbxznDCxoqms740XbeJ0Amh6aNeD XX7Q== X-Forwarded-Encrypted: i=1; AJvYcCUHxb5x4jNfcuTxf55KWE0i/QYC5+sDsjejD7onEKszYcUr4ohbT6Juwl3S8SZB1UMD53U=@dpdk.org X-Gm-Message-State: AOJu0YzhDm1hwr80MPtUUP4hC23lHpv+u2WbAyIwdCgc/+AE+Zl91THk 3wGLAvbLjQpJ0+t3iUnBs3zpoUlva3dfXduSQRzGly4R5/+c28lVbrI8SfU2K78= X-Gm-Gg: ASbGncvzWm2tPfVU2S5ewIYvNU1bx9wPfl5cXUXaKRHttGFQks6/EbI0xavXEF0jdad zMepuxYkaUzjVhqMcf36yjAKocsgah/UgO3iX1C7EFZ9w3fdWmZkehpM9pIR8DrYGlcX+GguDU4 tjh0NUCl6pETkUuLkr3zqBDF78+eq+FevejATMdRh/7fnvn34tnN6qSf+THOBDLpfMz7BATmbm4 BSE30K/5rmvwgskiuS5Uami3XNkVfWDkLe64BvdcFoBg46+aSh5EwxJw4zgMvmxTSYY1zlr6zQB 4IDBpR/YYVc4oxR7foUf5qbgdXQ= X-Google-Smtp-Source: AGHT+IGeLPuzI5MrzgtK+kGpjPxF4M0J9n9kqK4Um9CZzQsQRKthuBzxK25oM2+8u0qlEA6hJO4QYw== X-Received: by 2002:a05:6a20:6a1b:b0:1e0:d9ab:27f with SMTP id adf61e73a8af0-1e16541336cmr6654621637.37.1733261977761; Tue, 03 Dec 2024 13:39:37 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72541849bfasm10904252b3a.195.2024.12.03.13.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 13:39:37 -0800 (PST) Date: Tue, 3 Dec 2024 13:39:25 -0800 From: Stephen Hemminger To: Tomasz Duszynski Cc: Thomas Monjalon , , , , , , , , , , Subject: Re: [PATCH v16 1/4] lib: add generic support for reading PMU events Message-ID: <20241203133925.026b0694@hermes.local> In-Reply-To: <20241118073706.3129423-2-tduszynski@marvell.com> References: <20241025085414.3412068-1-tduszynski@marvell.com> <20241118073706.3129423-1-tduszynski@marvell.com> <20241118073706.3129423-2-tduszynski@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, 18 Nov 2024 08:37:03 +0100 Tomasz Duszynski wrote: > diff --git a/doc/guides/prog_guide/profile_app.rst b/doc/guides/prog_guide/profile_app.rst > index a6b5fb4d5e..ecb90a0d94 100644 > --- a/doc/guides/prog_guide/profile_app.rst > +++ b/doc/guides/prog_guide/profile_app.rst > @@ -7,6 +7,32 @@ Profile Your Application > The following sections describe methods of profiling DPDK applications on > different architectures. > > +Performance counter based profiling > +----------------------------------- > + > +Majority of architectures support some performance monitoring unit (PMU). > +Such unit provides programmable counters that monitor specific events. > + > +Different tools gather that information, like for example perf. > +However, in some scenarios when CPU cores are isolated and run > +dedicated tasks interrupting those tasks with perf may be undesirable. The data should be folded into telemetry rather than introducing yet another DPDK API for applications to deal with. > + > +In such cases, an application can use the PMU library to read such events via ``rte_pmu_read()``. > + > +By default, userspace applications are not allowed to access PMU internals. That can be changed > +by setting ``/sys/kernel/perf_event_paranoid`` to 2 (that should be a default value anyway) and > +adding ``CAP_PERFMON`` capability to DPDK application. Please refer to > +``Documentation/admin-guide/perf-security.rst`` under Linux sources for more information. Fairly > +recent kernel, i.e >= 5.9, is advised too. What happens on older kernels? > + > +As of now implementation imposes certain limitations: > + > +* Only EAL lcores are supported > + > +* EAL lcores must not share a cpu > + > +* Each EAL lcore measures same group of events > + > > Profiling on x86 > ---------------- > diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst > index 5063badf39..1c299293e0 100644 > --- a/doc/guides/rel_notes/release_24_11.rst > +++ b/doc/guides/rel_notes/release_24_11.rst Well 24.11 is released, so as a minimum will need rebase for 25.03