Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7668240ybi; Thu, 1 Aug 2019 11:47:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkjD5Jq6duX5QGecUBchHo0VQsAwVElPPjs8c1E706Lddqpqtfgn/x2WRAJib4tZK6f726 X-Received: by 2002:a65:6448:: with SMTP id s8mr121089744pgv.223.1564685237917; Thu, 01 Aug 2019 11:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564685237; cv=none; d=google.com; s=arc-20160816; b=dZkIwL4UhVk9aCWo+Wg1JA3cjQ632hXViUr7Pmf8WhdgW0OWEVMYc3w1CTG4KO2mKl 9qdk8JT7HycS1jxoSKpIFXePBFkcejncbbrLSxkTMFJQW1wunvmztURCgX7JUNXLKq8J Pt04dGbCq4S/7s6EhisEbgbPFGWTk3O6UL9MLv+b/g/4t50fv5WCfX3+dBAZUtx0OXxC m9zKWNN8vbyZSqv0IwWuIhFoAhzBVhIwJbWDP/jgJcDl4NN7KbwZXNuWalHsh+I/8uMK 7eJrJX74aFTpqPeA7aUzGFwXBOBDMFKZnBs0M1+AfJ+LZOapUdA3lj1dWxZtGdW1rYwx ISAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:date:from:dkim-signature; bh=BrDv6APd0h3KKvHtt3FYKhGAppJikXhHxXPF+0kU7LA=; b=Hj/Ezem33nreOkfmu4yjwHm1VqMcU7f9+zJR4/nfm9fPIdSzVqcgUOLPdncS+jR4rT g8NSjHCzi3iSb9Z+v/w9F7GAxqq9FlxNePSLk8Vfrk235HYF/W2tSpP78U1Nk5nkieQq 2mQJo1sUJKSQ431UTvkg6280Ijq3fuEq1z1Yu064dQNKg/ZPFKxxwDWEYA5CYUt8X/7y fxTK8hIUZiMbk/XkuvkWDTdw11PIXpqzCnKy3QJynLtKeAcMksD8AKJ+G5d7sGMahlAD zs5m2PZO7W3YRLkLiC4NCXmUFk3pJWw2z5B+saN/Ltn+hvzZcmNm4Pe7zTMQv6PLptlU fM5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=GVLIcWJG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19si35043107pgh.219.2019.08.01.11.47.02; Thu, 01 Aug 2019 11:47:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=GVLIcWJG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731035AbfHASar (ORCPT + 99 others); Thu, 1 Aug 2019 14:30:47 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:41156 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfHASar (ORCPT ); Thu, 1 Aug 2019 14:30:47 -0400 Received: by mail-qt1-f195.google.com with SMTP id d17so71153664qtj.8 for ; Thu, 01 Aug 2019 11:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maine.edu; s=google; h=from:date:to:cc:subject:message-id:user-agent:mime-version; bh=BrDv6APd0h3KKvHtt3FYKhGAppJikXhHxXPF+0kU7LA=; b=GVLIcWJG4pk+OPkIVwfx3j8MTPjtxN13IsNRR4Or8UVZsgqKu022eMxw5PhrIzNImF PBby+icwtwUyrM8K9wcd71jfEZR5fQ/MiYQFk9GjZH5HOxlCsOVS2A4kL1qzHVyXbbN8 MC5/+qiYfxl2wcyhaN+3Y+3mhLQTuNlYnnWo8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:user-agent :mime-version; bh=BrDv6APd0h3KKvHtt3FYKhGAppJikXhHxXPF+0kU7LA=; b=qJAZCYO9pIOunIi+EUve0mCBkaFAgicFHB1lPj1A7BYPtR8Z0djmDf6ztKJeIw1TBV BrhlXBxjz8eHKmzT49werpYXF4KMKTYOau+wW/yGv6wIiMCzSrLIaiG5Mun0P2sm9zVb LeamRSZiGnohq2EgIghKTRAOk36ggYa1lvYpZlvkh3kbMu1AlGl6z7ydINLlnXtjxecy QJ56gIiBc/7RqZ81rBWGy2UDV/J1Rx7mYcICwzXhW7Y+5KL6+jNkb0vLy07+JFjvkE0c XevaPX2mvjszpbALtbRtQB5ejCCzvA1TcOLS9l25YReqkZzYvQDkjq5L83GLH3rg2cLW q74A== X-Gm-Message-State: APjAAAWygazba0ZFwjWMFTyrBkGnyWnVhirJHhkCPIHQZ5vuTN/L1cm/ wEC3yPTsRr0sqQQYgMlzlNcH+IkpQT8= X-Received: by 2002:ac8:3794:: with SMTP id d20mr91528243qtc.392.1564684245935; Thu, 01 Aug 2019 11:30:45 -0700 (PDT) Received: from macbook-air (weaver.eece.maine.edu. [130.111.218.23]) by smtp.gmail.com with ESMTPSA id 18sm32650473qkh.77.2019.08.01.11.30.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 01 Aug 2019 11:30:44 -0700 (PDT) From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Thu, 1 Aug 2019 14:30:43 -0400 (EDT) X-X-Sender: vince@macbook-air To: linux-kernel@vger.kernel.org cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Andi Kleen , Chong Jiang , Simon Que Subject: [patch] perf.data documentation clarify HEADER_SAMPLE_TOPOLOGY format Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The perf.data file format documentation for HEADER_SAMPLE_TOPOLOGY specifies the layout in a confusing manner that doesn't match the rest of the document. This patch attempts to describe things consistent with the rest of the file. Signed-off-by: Vince Weaver diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt index 5f54feb19977..6a7dceaae709 100644 --- a/tools/perf/Documentation/perf.data-file-format.txt +++ b/tools/perf/Documentation/perf.data-file-format.txt @@ -298,16 +298,21 @@ Physical memory map and its node assignments. The format of data in MEM_TOPOLOGY is as follows: - 0 - version | for future changes - 8 - block_size_bytes | /sys/devices/system/memory/block_size_bytes - 16 - count | number of nodes - -For each node we store map of physical indexes: - - 32 - node id | node index - 40 - size | size of bitmap - 48 - bitmap | bitmap of memory indexes that belongs to node - | /sys/devices/system/node/node/memory + u64 version; // Currently 1 + u64 block_size_bytes; // /sys/devices/system/memory/block_size_bytes + u64 count; // number of nodes + +struct memory_node { + u64 node_id; // node index + u64 size; // size of bitmap + struct bitmap { + /* size of bitmap again */ + u64 bitmapsize; + /* bitmap of memory indexes that belongs to node */ + /* /sys/devices/system/node/node/memory */ + u64 entries[(bitmapsize/64)+1]; + } +}[count]; The MEM_TOPOLOGY can be displayed with following command: