Commit 3143906c authored by Vince Weaver's avatar Vince Weaver Committed by Arnaldo Carvalho de Melo
Browse files

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.

Signed-off-by: default avatarVince Weaver <vincent.weaver@maine.edu>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Chong Jiang <chongjiang@chromium.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Simon Que <sque@chromium.org>
Link: http://lkml.kernel.org/r/alpine.DEB.2.21.1908011425240.14303@macbook-air


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 38fe26b4
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -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: