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 9E05C45E21; Tue, 3 Dec 2024 23:00:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8937240A76; Tue, 3 Dec 2024 23:00:08 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 2FAAB4025D for ; Tue, 3 Dec 2024 23:00:07 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-215810fff52so32085025ad.1 for ; Tue, 03 Dec 2024 14:00:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1733263206; x=1733868006; 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=WBbnfrgCB37/qYeL83OpDGud64Ad3KtjHOlqhvFNFS0=; b=HF0sUX23aZo9dUrCVz+9AeajjW9XdVEQgycpGKgv4otZZKQDGAahUcoH4TVuRPSt6q YDlc7DKonnMZtIwUjvRh7jqCnEuDO1H34Y/S0DI9SApXhSMqVfOBF8ZW0zlMtNV6hxE9 9Tmi6aZIk4u2MF0v1AGBLomSjd6Qxpd6mbtdcyLBbn+FuD9tmlToxrn7YupC75GoXq2s 4IC3QffiM7j2LONqf7TfLmCnKsm7dBEYxR+Y4kWSXX+dnzhgFECRqd6uoFjYGbmjTNvI qZSLXSOL3At9ruXdh1U25ElGIx+/2u5gMKCV0IqTfGSAC0/iLGobaMEpteJ0R/yFxTGm U2/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733263206; x=1733868006; 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=WBbnfrgCB37/qYeL83OpDGud64Ad3KtjHOlqhvFNFS0=; b=aq6QEdeupbizg22li6+5u1brTRXmL8V5ovT3/p2jsjFOv75npW4EjCI+7ISnU0U+cj lHmQB9AJUBzIvqHPKHQaurf5vrBGCwK5Ad3gY84JupRkWzgIHbusRh3+z9b7FSJuJk1M whPLosbZBDxXKpqcqod7BNa8SBc0yy2vAMidKITAoffszHtvWdRs379cUnJ1kjO9PqOp NKHvLEJ+pd+vG6iRqfulncoQB9ftyF+ff9KmaP3/orvQMCzc9Z6Z8fOJHeCWMVlnXImW 9amuivbPKHhav45gRp/Fe4M+lTNWJhxx1jnZSHOQayb9f9ToJvA0eLtYcl98rbQMDzH1 AOSA== X-Forwarded-Encrypted: i=1; AJvYcCWLlxSZE90AE/FXvAb3llJHpl6/oH71eK8jyovEWPkwBRaciKyuqUJguILQd0eDvnSS+x4=@dpdk.org X-Gm-Message-State: AOJu0Yx7dUaRCLvhUQBwh8eHIqoZHpqhhif/hDGpuQijWf1Ig4k+y7Jr aV04ZtL3Z1XFYclcbR4xwUbBSD7ndu1okk5/o2y3iun2DOai09KVlHLti+rRdhE= X-Gm-Gg: ASbGncs+d9131851iIUaNHFuLoYcS2GH2o6NATBspA1OcKY3Tw3LSAcdaEfVySiFGly hpSiG8NAzogSsh5dwKU4FU1mvWuGYwVemDUPtR8sK4E/oBMXrt9pu6v2oHuT22gqI2r/Z0J3sU0 +36VrZb+8WZBSfVSKqrnFqG1Gj+guJwMKOzAeSAW/J7JsjqMsgjzuAigkAil2V8hEUz+ni51Pro xsJhb5Z782qWsDwaEy6+OOMmA8lr75T7bIrOonVxFaPJMYgivmg1h/1y0LpMb4job5zNU+Cg0fB dt9LJ79QN0oXuyxA9hYnzaCFtDQ= X-Google-Smtp-Source: AGHT+IFmX3enIGqH5IMN6uuBkTajDiGLjUJdHEZFnczT9n5LRa2+GCcIti2oogjQMUlfnFXXsIrqsg== X-Received: by 2002:a17:903:22cf:b0:215:a18c:88ed with SMTP id d9443c01a7336-215bd2503c8mr57319315ad.42.1733263206363; Tue, 03 Dec 2024 14:00:06 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2152198301fsm99777905ad.179.2024.12.03.14.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 14:00:06 -0800 (PST) Date: Tue, 3 Dec 2024 14:00:03 -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: <20241203140003.43af0cc7@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: > +Performance counter based profiling > +----------------------------------- > + > +Majority of architectures support some performance monitoring unit (PMU). > +Such unit provides programmable counters that monitor specific events. Sentence wording is awkward, maybe combine the two sentences and/or look to wikipedia or vendor for better definition. Also add PMU to glossary in programmer's guide > + > +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. > + > +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 Wrong path, should be /proc/sys/kernel/perf_event_paranoid The default in current kernels is 2. > +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. Provide link to kernel.org page for that doc please. https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html Since multiple things (even selinux) can restrict this. Maybe best to just add a generic paragraph about what is needed, and leave the security description up to the kernel and distro to handle. > + > +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 > +