Skip to contentSkip to conversation

perf.data documentation clarify HEADER_SAMPLE_TOPOLOGY format

PATCH Applied Vince Weaver 4 participants 4 messages Aug 1, 2019 – Aug 15, 2019 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf.data documentation clarify HEADER_SAMPLE_TOPOLOGY format

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.

tools/perf/Documentation/perf.data-file-format.txt +15 -10
index 5f54feb19977..6a7dceaae709 100644
@@ -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<NODE>/memory<INDEX>
+	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<NODE>/memory<INDEX> */
+                u64 entries[(bitmapsize/64)+1];
+        }
+}[count];
 
 The MEM_TOPOLOGY can be displayed with following command:
 
Acked-by on v1 1/1
#1 lore raw
Quoted 31 lines · Vince Weaver

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.

tools/perf/Documentation/perf.data-file-format.txt +5 -10
index 5f54feb19977..6a7dceaae709 100644
@@ -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<NODE>/memory<INDEX>
+	u64 version;            // Currently 1
+	u64 block_size_bytes;   // /sys/devices/system/memory/block_size_bytes
+	u64 count;              // number of nodes
+
+struct memory_node {

tools/perf/Documentation/perf.data-file-format.txt Physical memory map and its node assignments. · line 315

Quoted 10 lines
tools/perf/Documentation/perf.data-file-format.txt +10 -0
+        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<NODE>/memory<INDEX> */
+                u64 entries[(bitmapsize/64)+1];
+        }
+}[count];

thanks for doing this,
jirka

Quoted 3 lines
tools/perf/Documentation/perf.data-file-format.txt +0 -0
 The MEM_TOPOLOGY can be displayed with following command:
 
#2 lore raw

Em Fri, Aug 02, 2019 at 03:14:40PM +0200, Jiri Olsa escreveu:

Quoted 7 lines · Vince Weaver

tools/perf/Documentation/perf.data-file-format.txt Physical memory map and its node assignments. · line 315

Quoted 2 lines
tools/perf/Documentation/perf.data-file-format.txt +2 -0
+        }
+}[count];

thanks for doing this,

Thanks, applied.

- Arnaldo

#3 lore raw

[tip:perf/core] perf.data documentation: Clarify HEADER_SAMPLE_TOPOLOGY format

In reply to Vince Weaver
perf.data documentation: Clarify HEADER_SAMPLE_TOPOLOGY format
Commit-ID:  3143906c2770778d89b730e0342b745d1b4a8303
Gitweb:     https://git.kernel.org/tip/3143906c2770778d89b730e0342b745d1b4a8303
Author:     Vince Weaver <[email protected]>
AuthorDate: Thu, 1 Aug 2019 14:30:43 -0400
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 14 Aug 2019 10:59:59 -0300

perf.data documentation: Clarify HEADER_SAMPLE_TOPOLOGY format

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.

---
 tools/perf/Documentation/perf.data-file-format.txt | 25 +++++++++++++---------
 1 file changed, 15 insertions(+), 10 deletions(-)
tools/perf/Documentation/perf.data-file-format.txt +15 -10
index d030c87ed9f5..b0152e1095c5 100644
@@ -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<NODE>/memory<INDEX>
+	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<NODE>/memory<INDEX> */
+                u64 entries[(bitmapsize/64)+1];
+        }
+}[count];
 
 The MEM_TOPOLOGY can be displayed with following command: