columns are not printed at all.
The \fIlist\fP argument is comma delimited list of the columns. Currently
-supported are CPU, Core, Node, Socket, Book, Cache and Polarization columns. If the
-\fIlist\fP argument is given then always all requested columns are printed in
+supported are CPU, Core, Node, Socket, Book, Cache, Polarization and Address
+columns.
+If the \fIlist\fP argument is given then always all requested columns are printed in
the defined order. The Cache columns are separated by ':'.
Note that the optional \fIlist\fP argument cannot be separated from the
struct cpu_cache *caches;
int *polarization; /* cpu polarization */
+ int *addresses; /* physical cpu addresses */
};
static size_t sysrootlen;
COL_NODE,
COL_BOOK,
COL_CACHE,
- COL_POLARIZATION
+ COL_POLARIZATION,
+ COL_ADDRESS
};
static const char *colnames[] =
[COL_NODE] = "Node",
[COL_BOOK] = "Book",
[COL_CACHE] = "Cache",
- [COL_POLARIZATION] = "Polarization"
+ [COL_POLARIZATION] = "Polarization",
+ [COL_ADDRESS] = "Address"
};
desc->polarization[num] = POLAR_UNKNOWN;
}
+static void
+read_address(struct lscpu_desc *desc, int num)
+{
+ if (!path_exist(_PATH_SYS_CPU "/cpu%d/address", num))
+ return;
+ if (!desc->addresses)
+ desc->addresses = xcalloc(desc->ncpus, sizeof(int));
+ desc->addresses[num] = path_getnum(_PATH_SYS_CPU "/cpu%d/address", num);
+}
+
static int
cachecmp(const void *a, const void *b)
{
if (desc->polarization)
printf("%s", polar_modes[desc->polarization[i]]);
break;
+ case COL_ADDRESS:
+ if (desc->addresses)
+ printf("%d", desc->addresses[i]);
+ break;
}
}
read_topology(desc, i);
read_cache(desc, i);
read_polarization(desc, i);
+ read_address(desc, i);
}
qsort(desc->caches, desc->ncaches, sizeof(struct cpu_cache), cachecmp);