From patchwork Thu Dec 23 07:45:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12697990 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 569B6C433F5 for ; Thu, 23 Dec 2021 07:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=PpckLD3owEGEXYRXDlS814+c3ok0b3cgrHZuaiu+Uk8=; b=OiVwCSfyfm4G2xF8BmrfsUFusH 2PeeGnqiLyEzzm8AWpnMBRl5JGbxTiFX1kcUD0Y8oh/cj6idtQt8knzBuCzSLIi+5JsXHNnFSY8kP oHWdIEbrCa4XSCQEbf2tuMQ0B7UyasAwS1x4p1eCLXFVekrtBiM28mfGns9Txzbfj9hFjqRpLG0V5 KNWBOQxF1lJuFmftxjCxV22JWE8y10654KKQ5+2jtItFa0O42/BBA3dON0KU843wwahJBS7hWDlWA Z2dRN/R2NgBLIfs9u51zY1brnSAreWD09H2J+0IN1B72Hf1PSqNy+pBmrfFvjtrYTxSzVWEJJPkgh KY1ZB2rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Iss-00C1mQ-PL; Thu, 23 Dec 2021 07:51:31 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Io8-00BzXf-Bw for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 07:46:37 +0000 Received: by mail-yb1-xb49.google.com with SMTP id i187-20020a2522c4000000b006093b616e65so8615743ybi.17 for ; Wed, 22 Dec 2021 23:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=i7256vb/Zx8IIeVMwww3dL/k4OEqcir0FFGgHyZofME=; b=ULf7pncHNSXp74XAiBkRZsQ2We3PFB8Q6TLzGDSIonox8ZanH6Qkow4Mrc4PWRHQfP q/Sfhe3s5uOsFTdgq1wgbUSW0223h23SUnF8X++qM+vLzFZSBgWEYuACJss2wepreTnK Jf3gJiLFO2iaB53o4KLMpAQ0fWqkPZCaD8drbNrmQv2mcqSv+8yyrPecChcT2dckeMM/ k2w8pIiFpuL/8kSi1srTjFgPb/5EHoCETU/5ICYUhaN3EaDXOhXmvSZmadajv1/Qi5bV VSHoEm0TVW81+Qe9AIwsjsGB8B2Uq2SCU86B9CseVBXgUkMYa5KxDMu1vn6jG91+xUOU hFXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=i7256vb/Zx8IIeVMwww3dL/k4OEqcir0FFGgHyZofME=; b=435ST7g2Kc3iDcgyzdZccV1IazhC4YgSDyFaMTHpej6nAS93t43Jb4Bjt5e44A3+KY 2ZGYZppZnDpUFcFOlx2W7O+B1aP9sVP4eAAjFISsSQI6cSJwwOVwuDP7REBX7kSAKvLS iiB4qBYBzavBjQiA2d1VTna61jVUNKGXLgBiZu3aa/5ewKRjXcRp7l/LQrYYqhS0MfAC gILcc1lnPeUn5lvLog5S7OdCcmgCBdhXp4oELR7kdz57gRUqDLuLjm2EUUhNHEqIJ2/W EAM68I9NJxJZyNJmbc1dFcDemEqgpz1uxSCbwAFWICfSOupEPs+iTAiwyS95G6u8CXei cO4A== X-Gm-Message-State: AOAM532ZjAhaQl1b1Rwao9tihFHTcYYmeUhTbrzzM2LAvT7zcYmbQJUi 17WNol9BKNHh8Z4MqGKFHLC4R9j3kRlD X-Google-Smtp-Source: ABdhPJyR5JZf5bjSrz0ulaEcX4bGs7VsSsfLIz8hrDRGWaiBoyyjWL+6gtkZ7bJTmSJ7QJfv+tI/QK92QsEU X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:4fef:90ff:589d:24ca]) (user=irogers job=sendgmr) by 2002:a25:328b:: with SMTP id y133mr1567948yby.233.1640245595027; Wed, 22 Dec 2021 23:46:35 -0800 (PST) Date: Wed, 22 Dec 2021 23:45:04 -0800 In-Reply-To: <20211223074541.3318938-1-irogers@google.com> Message-Id: <20211223074541.3318938-12-irogers@google.com> Mime-Version: 1.0 References: <20211223074541.3318938-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.307.g9b7440fafd-goog Subject: [PATCH v2 11/48] perf cpumap: Add comments to aggr_cpu_id From: Ian Rogers To: Andi Kleen , Jiri Olsa , Namhyung Kim , John Garry , Kajol Jain , "Paul A . Clarke" , Arnaldo Carvalho de Melo , Riccardo Mancini , Kan Liang , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh , James Clark , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: eranian@google.com, Ian Rogers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_234636_481756_328D8C83 X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This code is already tested in topology.c. Reviewed-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/util/cpumap.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index f0121dd4fdcb..edd93e1db36a 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -7,11 +7,20 @@ #include #include +/** Identify where counts are aggregated, -1 implies not to aggregate. */ struct aggr_cpu_id { + /** A value in the range 0 to number of threads. */ int thread; + /** The numa node X as read from /sys/devices/system/node/nodeX. */ int node; + /** + * The socket number as read from + * /sys/devices/system/cpu/cpuX/topology/physical_package_id. + */ int socket; + /** The die id as read from /sys/devices/system/cpu/cpuX/topology/die_id. */ int die; + /** The core id as read from /sys/devices/system/cpu/cpuX/topology/core_id. */ int core; };