Skip to content

Commit 36143a1

Browse files
committed
utils/info: --topology -v shows topo info attrs
Signed-off-by: Brice Goglin <[email protected]>
1 parent f7e33d1 commit 36143a1

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

utils/hwloc/hwloc-info.1in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ This is the default if some objects are given on the command-line.
3737
\fB\-\-topology\fR
3838
Report a summary of the topology instead of about some specific objects.
3939
This is the default if no object is given on the command-line.
40+
If \-v is also given, topology info attributes are also shown.
4041
.TP
4142
\fB\-\-support\fR
4243
Report the features that are supported by hwloc on the topology.
@@ -266,6 +267,19 @@ To show the best-bandwidth node among NUMA nodes local to a PU:
266267
type = NUMANode
267268
...
268269

270+
To see info attributes of the topology:
271+
272+
$ hwloc-info --topology --verbose
273+
depth 0: 1 Machine (type #0)
274+
depth 1: 1 Package (type #1)
275+
depth 2: 2 Core (type #2)
276+
depth 3: 4 PU (type #3)
277+
Special depth -3: 1 NUMANode (type #13)
278+
info Backend = Linux
279+
info LinuxCgroup = /user/622
280+
info Architecture = x86_64
281+
info hwlocVersion = 3.0.0a1-git
282+
269283
.
270284
.\" **************************
271285
.\" See also section

utils/hwloc/hwloc-info.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,12 @@ main (int argc, char *argv[])
817817

818818
if (mode == HWLOC_INFO_MODE_TOPOLOGY) {
819819
hwloc_lstopo_show_summary(stdout, topology);
820+
if (verbose_mode > 0) {
821+
struct hwloc_infos_s *infos = hwloc_topology_get_infos(topology);
822+
unsigned i;
823+
for(i=0; i<infos->count; i++)
824+
printf("info %s = %s\n", infos->array[i].name, infos->array[i].value);
825+
}
820826

821827
} else if (mode == HWLOC_INFO_MODE_SUPPORT) {
822828
const struct hwloc_topology_support *support = hwloc_topology_get_support(topology);

utils/hwloc/test-hwloc-info.output

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ depth 0: 1 Machine (type #0)
55
depth 3: 24 PU (type #3)
66
Special depth -3: 2 NUMANode (type #13)
77

8-
# --topology
8+
# --topology --verbose
99
depth 0: 1 Machine (type #0)
1010
depth 1: 2 Group0 (type #12)
1111
depth 2: 6 Core (type #2)

utils/hwloc/test-hwloc-info.sh.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ set -e
4242
echo "# (default)"
4343
$info --if synthetic --input "node:2 core:3 pu:4"
4444
echo
45-
echo "# --topology"
46-
$info --if synthetic --input "node:2 core:3 pu:4" --topology
45+
echo "# --topology --verbose"
46+
$info --if synthetic --input "node:2 core:3 pu:4" --topology --verbose
4747
echo
4848
echo "# --support"
4949
$info --if synthetic --input "node:2 core:3 pu:4" --support

0 commit comments

Comments
 (0)