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 AB79942911 for ; Mon, 10 Apr 2023 18:12:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1760E40DDC; Mon, 10 Apr 2023 18:12:25 +0200 (CEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 51C1E40A81 for ; Mon, 10 Apr 2023 18:12:23 +0200 (CEST) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1a51ba7fdfcso7151085ad.3 for ; Mon, 10 Apr 2023 09:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1681143142; x=1683735142; 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=quTCQs2xerRhOo8xxvRrMvgO8RqEEuL404f0/2Uj/Mw=; b=1Y4E6rK4M2y85mzVUBx0nK177n17T3lBPb9uDndtBwVMJxtcLKICMWEzvQv8xFQ0YD Djl/rQRJr+ullJ6KRBDmOr7dophvUvBU1K9kq0KX7miV3hAbfO5ZG7MxCnFf8EMItSFO p1z2JH/jg/8Ydvm0fuc0hfU85/U0fpBtPKqECoABk49K6Hhg2jqXQUIdAWpdmc794HCy JUiGFp2eJh3VDTiKlCZ3nQCll0p263F/up7eAXEfShfKWSAe9238I+LehezEBSSFMtdb /pLZy2MHXSnu3GJRTrz/Bv4/CWBh0XrM38JDlfGS2mzFhj+W7+JRMai+MV/PpzpCj+2p 60dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143142; x=1683735142; 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=quTCQs2xerRhOo8xxvRrMvgO8RqEEuL404f0/2Uj/Mw=; b=WIIb+UmKzKdIVH9TsKM/bsbAX2OmZZO/iO5cFRdl9S+4Ja26h5qa0sYFu2GkrBM3s6 yl4jS1LUEF6DUn+RoKDug0Ma5EphlpvNkchG2U6vqluwr3USoFU80apVNlzq5gPkIyeB F8LKwuIfBezuKuJmHanvyl1WU/t9N6qA0z3pGfbgRdBGaDGNwn24gJ0utUuHyem90yZD pOUl79+DReYGo1DEG5gd6/KEFn8ymcf5CBKx0UPkGacpgxyh717iqcbip5jOR5sbKoy3 40Pyoer2ZfclsIlZlRXZsG8voiqTX8pa+5H+cLF4vWyGXOwBj88IPN0Zuc5vJIl7Lh/8 teiw== X-Gm-Message-State: AAQBX9foxdA63Fy2+LKt/rtr4cKCpYHdCCDmZeBNjy+pbPc80BpqL7BY HID2RANPSUa3mA49hsVIev0vpw== X-Google-Smtp-Source: AKy350bCi6rW1Y4L0YklGGwafpTbid/ogzLOigZJVexKS/shdn577fELAsl4qKNa06SW4B96I6UYAQ== X-Received: by 2002:aa7:956d:0:b0:5a8:aca5:817d with SMTP id x13-20020aa7956d000000b005a8aca5817dmr9686431pfq.5.1681143142387; Mon, 10 Apr 2023 09:12:22 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f4-20020aa782c4000000b006089fb79f1esm8299341pfn.96.2023.04.10.09.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 09:12:22 -0700 (PDT) Date: Mon, 10 Apr 2023 09:12:20 -0700 From: Stephen Hemminger To: Antonio Di Bacco Cc: users@dpdk.org Subject: Re: Measuring core frequency with dpdk Message-ID: <20230410091220.1444042f@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On Mon, 10 Apr 2023 16:48:14 +0200 Antonio Di Bacco wrote: > Is it possible to measure the core frequency using a DPDK api? Not the > maximum or nominal frequency but the actual number of instruction > cycles per second. > > Best regards, > Anna The Time Stamp Counter https://en.wikipedia.org/wiki/Time_Stamp_Counter gets incremented at the CPU clock rate. DPDK API to read the TSC clock rate is rte_get_tsc_hz(). Internally, the DPDK determines the clock rate either by using architecture specific information if available or simple heuristic of number of ticks by doing a sleep(). See lib/eal/common/eal_common_timer.c for the details.